
12 Nov
2008
12 Nov
'08
7:30 a.m.
Hi, Frank Mori Hess wrote:
... The signal does not hold any locks when it runs a slot. Signals only use mutexes to protect their own data (like the list of connected slots). So a signal invoked concurrently by multiple threads can result in a slot to running concurrently.
It looks like the implementation of operator(), which emits the signal, locks a mutex, makes a local copy of the state, unlocks the mutex and uses the local copy to emit the signal. What happens if some other thread disconnects after operator() unlocked the mutex, but before the signal is emitted? Will the signal be delivered anyway? Thanks BR, Dmitry