diff options
author | Thomas Pfaff <tpfaff@gmx.net> | 2001-01-12 01:23:46 +0000 |
---|---|---|
committer | Christopher Faylor <cgf@gcc.gnu.org> | 2001-01-12 01:23:46 +0000 |
commit | 69e905c854d301b0cbc0723a6fd232b2b3bc6e35 (patch) | |
tree | 3413aae519148394da951f70ce6b49cfa041d228 /gcc/gthr-win32.h | |
parent | 0fc39d8ad7294b568c61c76dca2d9ee860ab3526 (diff) | |
download | gcc-69e905c854d301b0cbc0723a6fd232b2b3bc6e35.zip gcc-69e905c854d301b0cbc0723a6fd232b2b3bc6e35.tar.gz gcc-69e905c854d301b0cbc0723a6fd232b2b3bc6e35.tar.bz2 |
gthr-win32.h (__gthread_objc_thread_get_data): Save and restore Win32 LastError.
* gthr-win32.h (__gthread_objc_thread_get_data): Save and restore Win32
LastError.
(__gthread_getspecific): Ditto.
From-SVN: r38932
Diffstat (limited to 'gcc/gthr-win32.h')
-rw-r--r-- | gcc/gthr-win32.h | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h index 119cbc7..dbe5e5b 100644 --- a/gcc/gthr-win32.h +++ b/gcc/gthr-win32.h @@ -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 |