Boost logo

Boost Users :

Subject: Re: [Boost-users] Signals2 benchmark
From: Bjorn Reese (breese_at_[hidden])
Date: 2015-02-06 13:06:37

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.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at