summaryrefslogtreecommitdiffstats
path: root/Include/pythread.h
diff options
context:
space:
mode:
authorSjoerd Mullender <sjoerd@acm.org>1992-09-11 15:19:27 (GMT)
committerSjoerd Mullender <sjoerd@acm.org>1992-09-11 15:19:27 (GMT)
commitd10d8291f1de5bef74628bd1c766403ee9444dca (patch)
tree4a487cf3ae0b2afb303609ba7bd666265c947723 /Include/pythread.h
parent0aead9f1bac4f9fd962fedff2e377d69bb33fee6 (diff)
downloadcpython-d10d8291f1de5bef74628bd1c766403ee9444dca.zip
cpython-d10d8291f1de5bef74628bd1c766403ee9444dca.tar.gz
cpython-d10d8291f1de5bef74628bd1c766403ee9444dca.tar.bz2
Added C++ support in thread.h; don't use signals if not strictly
necessary, and when they are, use SIGKILL; when compiled with -DDEBUG, only print debug messages when "THREADDEBUG" is set in the environment.
Diffstat (limited to 'Include/pythread.h')
-rw-r--r--Include/pythread.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/Include/pythread.h b/Include/pythread.h
index fb2ff48..e29f7e6 100644
--- a/Include/pythread.h
+++ b/Include/pythread.h
@@ -1,19 +1,24 @@
#ifndef _THREAD_H_included
#define _THREAD_H_included
-#ifdef __STDC__
+#if defined(__STDC__) || defined(__cplusplus)
#define _P(args) args
#else
#define _P(args) ()
#endif
+typedef void *type_lock;
+typedef void *type_sema;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void init_thread _P((void));
int start_new_thread _P((void (*)(void *), void *));
void exit_thread _P((void));
void _exit_thread _P((void));
-typedef void *type_lock;
-
type_lock allocate_lock _P((void));
void free_lock _P((type_lock));
int acquire_lock _P((type_lock, int));
@@ -21,8 +26,6 @@ int acquire_lock _P((type_lock, int));
#define NOWAIT_LOCK 0
void release_lock _P((type_lock));
-typedef void *type_sema;
-
type_sema allocate_sema _P((int));
void free_sema _P((type_sema));
void down_sema _P((type_sema));
@@ -31,6 +34,10 @@ void up_sema _P((type_sema));
void exit_prog _P((int));
void _exit_prog _P((int));
+#ifdef __cplusplus
+}
+#endif
+
#undef _P
#endif