|
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: http://www.nabble.com/-signals-threadsafe-version--Atomic-disconnects-tp15412841p15412841.html Sent from the Boost - Dev mailing list archive at Nabble.com.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk