
On Tue, 12 Jul 2005 23:50:08 -0400, Gili <cowwoc@bbs.darktech.org> wrote:
If one creates a new boost::thread within DLLMain or a function it invokes, CreateThread (invoked by Boost) creates a new thread but does not start it. Boost's code then waits on the native thread to start before returning from the constructor but because this never occurs it blocks forever.
Does boost::thread use CreateThread? Is the author aware of the potential memory leaks that can result from this?
From MSDN:
"A thread that uses functions from the static C run-time libraries should use the _beginthread and _endthread C run-time functions for thread management rather than CreateThread and ExitThread. Failure to do so results in small memory leaks when ExitThread is called. Note that this is not a problem with the C run-time in a DLL." -- Be seeing you.