Boost logo

Boost Users :

Subject: Re: [Boost-users] Mixing signals2 and asio mechanism failing
From: Frank Mori Hess (fmh6jj_at_[hidden])
Date: 2013-10-20 13:34:17


On Sunday, October 20, 2013, ustulation wrote:
> I'd posted a query here too:
> http://stackoverflow.com/questions/19476578/mixing-boostasio-and-boostsi
> gnals2-giving-problems
>
> In the hack there I have assumed that signals make a copy of slots
> before executing them and hence that hack would work -> it would delete
> the actual functor when connecting dummy() and then the copy once
> slot() returns (assuming that the signal had been fired and the control
> was inside slot() when stop() was called). Is that assumption correct
> (about copying the list of slots before executing them) ? I got it
> from:
> http://stackoverflow.com/a/4490785/1060004

It avoids copying the slot list unless it has to (it has to when you
connect a slot while an invocation is in progress). If it does have to
copy the slot list, it will clean up all the disconnected slots from the
new copy and discard the old copy when all invocations using it complete.
These are implementation details though, it would be best not to rely on
them.




Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net