I wonder if it would be worthwhile to give users the ability to
decide whether to enable TLS in case they don't need LoadLibrary()
or not. What do you think?
Martin
[EMAIL PROTECTED] wrote:
Author: faridz
Date: Thu Nov 13 09:57:50 2008
New Revision: 713762
URL: http://svn.apache.org/viewvc?rev=713762&view=rev
Log:
2008-11-13 Farid Zaripov <[EMAIL PROTECTED]>
STDCXX-1023
* include/rw/_config.h [_WIN32 && _RWSTD_LIB_SRC]: Disable
using of implicit TLS variables in stdcxx library on Windows.
Modified:
stdcxx/branches/4.2.x/include/rw/_config.h
Modified: stdcxx/branches/4.2.x/include/rw/_config.h
URL:
http://svn.apache.org/viewvc/stdcxx/branches/4.2.x/include/rw/_config.h?rev=713762&r1=713761&r2=713762&view=diff
==============================================================================
--- stdcxx/branches/4.2.x/include/rw/_config.h (original)
+++ stdcxx/branches/4.2.x/include/rw/_config.h Thu Nov 13 09:57:50 2008
@@ -278,6 +278,18 @@
#ifdef _WIN32
# define _RWSTD_NO_STATIC_MUTEX_INIT
# define _RWSTD_PATH_SEP '\\'
+# ifdef _RWSTD_LIB_SRC
+ // Don't use implicit TLS in our library on Windows because of the TLS
+ // might not be initialized when our library DLL or the DLL, that
+ // linked statically against our library, is loaded explicitly using
+ // LoadLibrary() function. (STDCXX-1023)
+# ifndef _RWSTD_NO_TLS
+# define _RWSTD_NO_TLS
+# endif
+# ifdef _RWSTD_THREAD
+# undef _RWSTD_THREAD
+# endif
+# endif // _RWSTD_LIB_SRC
#endif // _WIN32
#ifndef _RWSTD_PATH_SEP