|
Boost : |
From: Tony Juricic (tonygeek_at_[hidden])
Date: 2004-08-01 12:55:45
"Bronek Kozicki" wrote
>I think that definition of _tls_used (from Holger) is
> something new and useful :>
That's great!
_tls_used variable appears to be absolutely required. To explain, I was
testing one ordinary (not using any boost code) static library with VC7.1
and forcing .tss segment creation with __declspec(thread) as in example:
<code>
void NTAPI tls_callback (PVOID, DWORD Reason, PVOID)
{
if(Reason == DLL_THREAD_DETACH)
{
on_thread_exit();
}
else if(Reason == DLL_PROCESS_DETACH)
{
on_thread_exit();
on_process_exit();
}
}
#pragma data_seg(push, old_seg)
#pragma data_seg(".CRT$XLB")
DWORD tls_callback_ptr = (DWORD)tls_callback;
#pragma data_seg(pop, old_seg)
__declspec(thread) int ithread;
... some other library code
</code>
I was surprised to find that tls_callback code was not invoked at all!
Tony
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk