$include_dir="/home/hyper-archives/boost-users/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-users] [boost-users][signals2] thread-safe disconnection for intrusively ref-counted objects
From: Igor R (boost.lists_at_[hidden])
Date: 2009-05-12 12:17:47
Hello,
Is there any trick or customization that would allow the subj?
I mean the following situation:
// pseudo-code!
class intrusively_refcounted : //...
{
private:
void listenToAsyncSubsystem()
{
// signals will come from another thread
asyncSubsystem_.someEvent.connect(slot_type(&intrusively_refcounted::handler,
this).track(???)); // can't use here shared_ptr/weak_ptr for tracking
}
};
I could store a connection object, so that it would be
destroyed/disconnected in ~intrusively_refcounted(), but I guess it's
not thread-safe, just like the approach with "trackable".
So what would be the correct approach?
Thanks!