Boost logo

Boost :

Subject: Re: [boost] Fwd: [signals2][review] little REVIEW
From: Dmitry Goncharov (dgoncharov_at_[hidden])
Date: 2008-11-12 02:30:05


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


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk