On Fri, Feb 6, 2015 at 1:06 PM, Bjorn Reese
On 02/06/2015 06:45 PM, Joren Heit wrote:
One thing I don't quite grasp yet, is the following. Suppose one thread disconnects a slot while another fires a signal connected to that slot. You say that the implementation must make sure that the signal is not fired after the disconnect-call returns. But won't this be undefined behaviour, as there is no way of knowing which will grab the lock first?
The easiest solution would be to store the slot as a shared_ptr, and make a copy of it (pin it) each time you call the slot.
So Thread 1: call signal,... copy slot shared_ptr,... Thread 2: disconnect, clean up resources, set global ptrUsedBySlot = null (since it is no longer used, right?) Thread 1: call slot Thread 1: crash on null ptrUsedBySlot
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users