Boost logo

Boost :

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
>> key!
>> i/e. in this section of code:
>> {
>> switch (reason)
>> {
>> InitializeCriticalSection(&cs);
>> key = TlsAlloc();
>> break;
>> ...
>> 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, gregod at, cpdaniel at, john at