C++ observer pattern via boost.signals2
Boost.Signals2 is a thread-safe library. It uses mutex locking internally. There are some caveats, as explained in this article:


  Almost all classes provided by Boost.Signals2 are thread safe and can
  be used in multithreaded applications. For example, objects of type
  boost::signals2::signal and boost::signals2::connection can be
  accessed from different threads.
  
  On the other hand, boost::signals2::shared_connection_block is not
  thread safe. This limitation is not important because multiple objects
  of type boost::signals2::shared_connection_block can be created in
  different threads and can use the same connection object.


but in its simplest and default forms, Boost.Signals2 is multi-threading safe.

Your given example is, indeed, thread-safe.


  What happens if an Observer is destructed during notifyObservers?


The slot is disconnected preemptively.