From: Beman Dawes (bdawes_at_[hidden])
Date: 2002-02-18 11:09:53
At 10:09 AM 2/18/2002, bill_kempf wrote:
>--- In boost_at_y..., "ajp_m" <a.maclean_at_a...> wrote:
>> A colleague of mine found the problem (many thanks Mike!).
>> I did not compile the thread library as a DLL (silly me!).
>> Consequently, PROCESS_ATTACH in threadmon.cpp was not allocating
>> i/e. in this section of code:
>> BOOL APIENTRY DllMain(HANDLE module, DWORD reason, LPVOID)
>> switch (reason)
>> case DLL_PROCESS_ATTACH:
>> key = TlsAlloc();
>> Of course this begs the question:
>> Is it possible to modify the code so that if it is not compiled as
>> DLL the code will still function correctly?
>The actual build process compiles most of the library as a static
>link library, but the threadmon stuff has to be in a DLL,
>unfortunately. This is a consequence of the Win32 MT design where
>DllMain() is the only mechanism that allows you to cleanup thread
Can you put a specific check into the threadmod code to give an #error if
it isn't being compiled as a DLL? Only to apply to appropriate compilers,
of course. Would save a lot of grief, I'd expect.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk