[signals] scoped_blocker for connections?
1 Mar
2007
1 Mar
'07
9:14 p.m.
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
6464
Age (days ago)
6464
Last active (days ago)
0 comments
1 participants
participants (1)
-
Frank Mori Hess