Boost logo

Boost Users :

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


Is there any trick or customization that would allow the subj?
I mean the following situation:

// pseudo-code!
class intrusively_refcounted : //...
  void listenToAsyncSubsystem()
    // signals will come from another thread
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?


Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at