Boost logo

Boost :

From: Johan Torp (johan.torp_at_[hidden])
Date: 2008-02-11 10:11:11

I'm wondering if the new thread safe implementation of signals guarantees
atomic disconnects.

line1: signal<void(), multi_threaded> sig;
line2: thread t(sig); // Start a new thread which will emit "sig"
line3: sig.connect(&some_func);
line4: sig.disconnect(&some_func);
line5: ...

Am I guaranteed that some_func isn't called at line 5 or afterwards?

If disconnect is blocking, how do you prevent the following dead-lock during
signal emission?
- Emitting thread tries to acquire a mutex X via a slot
- Disconnect calling thread is holding X and gets blocked on disconnect

Best Regards, Johan Torp

View this message in context:
Sent from the Boost - Dev mailing list archive at

Boost list run by bdawes at, gregod at, cpdaniel at, john at