summaryrefslogtreecommitdiff
path: root/win32/win32thread.h
diff options
context:
space:
mode:
authorMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-25 15:42:07 +0000
committerMalcolm Beattie <mbeattie@sable.ox.ac.uk>1997-11-25 15:42:07 +0000
commit48bfcc53740a66ec5a66616b846e1db9955c1c69 (patch)
tree2de7728957d83a013605f4f68638b4bbef4565a2 /win32/win32thread.h
parentfd206186f8bcdcb1b41bbddfb851c60acb937fcd (diff)
parentd40103885dfef00fdafa10024e6e4d5e414d1403 (diff)
downloadperl-48bfcc53740a66ec5a66616b846e1db9955c1c69.tar.gz
Integrate from ansi branch to mainline.
p4raw-id: //depot/perl@296
Diffstat (limited to 'win32/win32thread.h')
-rw-r--r--win32/win32thread.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/win32/win32thread.h b/win32/win32thread.h
index d2dfe4225c..0d92ffc96f 100644
--- a/win32/win32thread.h
+++ b/win32/win32thread.h
@@ -105,14 +105,27 @@ typedef HANDLE perl_mutex;
typedef THREAD_RET_TYPE thread_func_t(void *);
+
START_EXTERN_C
+
+#if defined(PERLDLL) && (!defined(__BORLANDC__) || defined(_DLL))
+extern __declspec(thread) struct thread *Perl_current_thread;
+#define SET_THR(t) (Perl_current_thread = t)
+#define THR Perl_current_thread
+#else
+#define THR Perl_getTHR()
+#define SET_THR(t) Perl_setTHR(t)
+#endif
+
void Perl_alloc_thread_key _((void));
int Perl_thread_create _((struct perl_thread *thr, thread_func_t *fn));
void Perl_set_thread_self _((struct perl_thread *thr));
+struct perl_thread *Perl_getTHR _((void));
+void Perl_setTHR _((struct perl_thread *t));
END_EXTERN_C
#define INIT_THREADS NOOP
-#define ALLOC_THREAD_KEY Perl_alloc_thread_key()
+#define ALLOC_THREAD_KEY NOOP
#define SET_THREAD_SELF(thr) Perl_set_thread_self(thr)
#define JOIN(t, avp) \
@@ -122,12 +135,7 @@ END_EXTERN_C
croak("panic: JOIN"); \
} STMT_END
-#define SET_THR(t) \
- STMT_START { \
- if (TlsSetValue(thr_key, (void *) (t)) == 0) \
- croak("panic: TlsSetValue"); \
- } STMT_END
-
#define YIELD Sleep(0)
#endif /* _WIN32THREAD_H */
+