|
Boost Users : |
From: Frank Mori Hess (frank.hess_at_[hidden])
Date: 2007-03-01 16:14:13
I wonder if it might be convenient to provide a scoped_blocker object that
lets a connection be blocked/unblocked in an exception-safe way, similar
to how a scoped_lock locks a mutex, or a scoped_ptr owns allocated memory.
A fancier scheme would be to provide a shared_blocker, where when you
request a shared_block from the connection it does reference counting so
the connection remains blocked until the last shared_blocker (requested by
any connection handle object referring to the same connection body) goes
out of scope. This could be implemented with a shared_ptr that has a
custom deleter, and a weak_ptr kept in the connection body to allow
different connection handles to get copies of the same shared_ptr.
-- Frank
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