gthr-win32.h (__gthread_objc_thread_get_data): Save and restore Win32 LastError.
authorThomas Pfaff <tpfaff@gmx.net>
Fri, 12 Jan 2001 01:23:46 +0000 (01:23 +0000)
committerChristopher Faylor <cgf@gcc.gnu.org>
Fri, 12 Jan 2001 01:23:46 +0000 (01:23 +0000)
* gthr-win32.h (__gthread_objc_thread_get_data): Save and restore Win32
LastError.
(__gthread_getspecific): Ditto.

From-SVN: r38932

gcc/ChangeLog
gcc/gthr-win32.h

index a04f1355eb81d99d6c96608de71b0b68610c949f..0a3c2e64d87ea38309f2b2e1a3ada3fb2efe66d7 100644 (file)
@@ -1,3 +1,9 @@
+2001-01-10  Thomas Pfaff <tpfaff@gmx.net>
+
+       * gthr-win32.h (__gthread_objc_thread_get_data): Save and restore Win32
+       LastError.
+       (__gthread_getspecific): Ditto.
+
 Fri Jan 12 00:04:00 MET 2001  Jan Hubicka  <jh@suse.cz>
 
        * i386.c (ix86_comparison_operator, fcmov_comparison_operator,
index 119cbc7d9b9933ddcc7d4985eb18be22c6dbd2cb..dbe5e5b4f346dfe8d88518a3bb186de04734b422 100644 (file)
@@ -204,7 +204,16 @@ __gthread_objc_thread_set_data(void *value)
 void *
 __gthread_objc_thread_get_data(void)
 {
-  return TlsGetValue(__gthread_objc_data_tls);          /* Return thread data.      */
+  DWORD lasterror;
+  void *ptr;
+
+  lasterror = GetLastError();
+
+  ptr = TlsGetValue(__gthread_objc_data_tls);          /* Return thread data.      */
+
+  SetLastError( lasterror );
+
+  return ptr;
 }
 
 /* Backend mutex functions */
@@ -413,7 +422,16 @@ __gthread_key_delete (__gthread_key_t key)
 static inline void *
 __gthread_getspecific (__gthread_key_t key)
 {
-  return TlsGetValue (key);
+  DWORD lasterror;
+  void *ptr;
+
+  lasterror = GetLastError();
+
+  ptr = TlsGetValue(key);
+
+  SetLastError( lasterror );
+
+  return ptr;
 }
 
 static inline int