Boost logo

Boost Users :

From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2007-02-22 18:19:07


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We could implement a thread-safe post-disconnect callback by using the
existing tracking functionality. That is, the connection body could hold
a "cleanup" shared_ptr with a custom deleter. The custom deleter would
run the user's cleanup callback. A weak_ptr copy of the cleanup
shared_ptr would be kept just like it was any other tracked object. When
disconnect() is called, the cleanup shared_ptr would be reset. If the
signal is being invoked concurrently when disconnect() is called, the
cleanup code won't get run until the last invocation is done with the slot
and destroys its copy of the cleanup shared_ptr.

BTW, I've added support for a two-parameter version of signals::track() to
thread_safe_signals/track.hpp. It seems to work okay, the only thing I
don't like about it is it implies there a coupling required between the
value and the tracked shared_ptr, when really there isn't.

- --
Frank
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFF3iTv5vihyNWuA4URAkzWAKDHL0MjcFGmAvKbWoBYmhNN5RiCMACgypCS
SLJPrYcUaR0u4YTTS35lEZQ=
=dCrK
-----END PGP SIGNATURE-----


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