summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-05-17 19:05:37 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-05-17 19:05:37 (GMT)
commit37c4a581adba19a71bdc30897e11a4be2d24b2ce (patch)
tree9e1c46e9cd0b8c0e41b8d692d4527228a718e7c0 /unix/tclUnixThrd.c
parentcfd3e7533755f50f92a64c9a5b637b52f30ae3ee (diff)
parent4f1ea4779be85d8837f3a133b52d3b5aa9e53fda (diff)
downloadtcl-37c4a581adba19a71bdc30897e11a4be2d24b2ce.zip
tcl-37c4a581adba19a71bdc30897e11a4be2d24b2ce.tar.gz
tcl-37c4a581adba19a71bdc30897e11a4be2d24b2ce.tar.bz2
Merge 8.7, but keep TCL_THREADS undefined in tcl.h (since that's no longer necessary)
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r--unix/tclUnixThrd.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 5d825fd..eb99d68 100644
--- a/unix/tclUnixThrd.c
+++ b/unix/tclUnixThrd.c
@@ -13,7 +13,7 @@
#include "tclInt.h"
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
/*
* masterLock is used to serialize creation of mutexes, condition variables,
@@ -66,7 +66,7 @@ TclpThreadCreate(
int flags) /* Flags controlling behaviour of the new
* thread. */
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_attr_t attr;
pthread_t theThread;
int result;
@@ -144,7 +144,7 @@ Tcl_JoinThread(
* thread we wait upon will be written into.
* May be NULL. */
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
int result;
unsigned long retcode, *retcodePtr = &retcode;
@@ -158,7 +158,7 @@ Tcl_JoinThread(
#endif
}
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
/*
*----------------------------------------------------------------------
*
@@ -202,7 +202,7 @@ TclpThreadExit(
Tcl_ThreadId
Tcl_GetCurrentThread(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
return (Tcl_ThreadId) pthread_self();
#else
return (Tcl_ThreadId) 0;
@@ -231,7 +231,7 @@ Tcl_GetCurrentThread(void)
void
TclpInitLock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_lock(&initLock);
#endif
}
@@ -257,7 +257,7 @@ TclpInitLock(void)
void
TclFinalizeLock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
/*
* You do not need to destroy mutexes that were created with the
* PTHREAD_MUTEX_INITIALIZER macro. These mutexes do not need any
@@ -288,7 +288,7 @@ TclFinalizeLock(void)
void
TclpInitUnlock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_unlock(&initLock);
#endif
}
@@ -317,7 +317,7 @@ TclpInitUnlock(void)
void
TclpMasterLock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_lock(&masterLock);
#endif
}
@@ -343,7 +343,7 @@ TclpMasterLock(void)
void
TclpMasterUnlock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_unlock(&masterLock);
#endif
}
@@ -370,7 +370,7 @@ TclpMasterUnlock(void)
Tcl_Mutex *
Tcl_GetAllocMutex(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_t **allocLockPtrPtr = &allocLockPtr;
return (Tcl_Mutex *) allocLockPtrPtr;
#else
@@ -378,7 +378,7 @@ Tcl_GetAllocMutex(void)
#endif
}
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
/*
*----------------------------------------------------------------------