Boost logo

Boost Users :

Subject: [Boost-users] boost::thread join() and DLL unloading
From: Christopher Pisz (cpisz_at_[hidden])
Date: 2011-09-14 17:48:06

My dll seems to be hanging in the when passed to regsvr32
I debugged through it and it is in deadlock on a boost::thread::join()

The call stack tells me:
The DLL is unloading
The destructor to a global has been called
That global contains a boost::thread object, on which join() has been called.

(The boost::thread procedure has already exited)

join() never returns.

I've googled for a few hours and seen people mention something to the effect
of "you cannot call join from DllMain" and "while DLL is unloading", but no
explanation or alternative.

How would I go about fixing this problem?
I don't think I can guarentee noone will ever make a global instance of my

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