
On Thursday, May 12, 2011, Phil Bouchard wrote:
Hi everybody,
I was wondering if there is anybody familiar enough with Block Pointer that could give me a hand regarding multithread support. Once again the test file is at: https://svn.boost.org/svn/boost/sandbox/block_ptr/libs/smart_ptr/example/ thread_test.cpp
The main class I am trying to protect with a mutex is block_header from: https://svn.boost.org/svn/boost/sandbox/block_ptr/boost/block_ptr.hpp
It looks like you might be affected by the "static initialization order fiasco". Your test creates a global block_ptr, whose constructor seems to eventually use some class static boost::mutex. It's not clear that the constructors for the static boost::mutex will necessarily be run before the constructor of your global block_ptr.