To cite @sdroege here
It's worth a note in the clicked function that you should really never ever keep a mutex (or refcell) locked/borrowed while: emitting signals, notifying property changes, anything that can cause these to happen. Because that will call into external code, and that external code might call back into your object, trying to use the same mutex/refcell and then you have a problem :)
Until recently we had an example here.
However, I don't think I embedded it nicely in the chapter.
Now that we use Cell instead RefCell for Copy types it definitely does not work anymore.
I suggest to add a small section about this topic, most probably at the end of the signal chapter.
Ideally, it would be a small self-contained example which demonstrates the problem.
Then we explain it and solve it.
To cite @sdroege here
Until recently we had an example here.
However, I don't think I embedded it nicely in the chapter.
Now that we use
CellinsteadRefCellforCopytypes it definitely does not work anymore.I suggest to add a small section about this topic, most probably at the end of the signal chapter.
Ideally, it would be a small self-contained example which demonstrates the problem.
Then we explain it and solve it.