summaryrefslogtreecommitdiff
path: root/gcc/gthr-win32.h
diff options
context:
space:
mode:
authorcgf <cgf@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-12 01:23:46 +0000
committercgf <cgf@138bc75d-0d04-0410-961f-82ee72b054a4>2001-01-12 01:23:46 +0000
commitbc7da7ad25a2593da658a98528015e3e158f3e08 (patch)
tree3413aae519148394da951f70ce6b49cfa041d228 /gcc/gthr-win32.h
parent5f9d28869a1983f9a9b542c1fe80e1f35b899384 (diff)
downloadgcc-bc7da7ad25a2593da658a98528015e3e158f3e08.tar.gz
* gthr-win32.h (__gthread_objc_thread_get_data): Save and restore Win32
LastError. (__gthread_getspecific): Ditto. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@38932 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gthr-win32.h')
-rw-r--r--gcc/gthr-win32.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/gcc/gthr-win32.h b/gcc/gthr-win32.h
index 119cbc7d9b9..dbe5e5b4f34 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