summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixThrd.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-05-17 18:53:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-05-17 18:53:29 (GMT)
commit4f1ea4779be85d8837f3a133b52d3b5aa9e53fda (patch)
tree401339ab1470b40cccd1bec272ac42427c694d92 /unix/tclUnixThrd.c
parent4e12ee1bc4fe5d4c49f614f7e18c6df1c8ea0e40 (diff)
parentf44e7c1795fe27f3f37e692f275545e3fe73ebd6 (diff)
downloadtcl-4f1ea4779be85d8837f3a133b52d3b5aa9e53fda.zip
tcl-4f1ea4779be85d8837f3a133b52d3b5aa9e53fda.tar.gz
tcl-4f1ea4779be85d8837f3a133b52d3b5aa9e53fda.tar.bz2
TIP #491 implementation: Threading Support: phasing out non-threaded builds
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r--unix/tclUnixThrd.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c
index 120d5d5..76228a3 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
#ifndef TCL_NO_DEPRECATED
typedef struct {
@@ -74,7 +74,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;
@@ -152,7 +152,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;
@@ -166,7 +166,7 @@ Tcl_JoinThread(
#endif
}
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
/*
*----------------------------------------------------------------------
*
@@ -210,7 +210,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;
@@ -239,7 +239,7 @@ Tcl_GetCurrentThread(void)
void
TclpInitLock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_lock(&initLock);
#endif
}
@@ -265,7 +265,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
@@ -296,7 +296,7 @@ TclFinalizeLock(void)
void
TclpInitUnlock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_unlock(&initLock);
#endif
}
@@ -325,7 +325,7 @@ TclpInitUnlock(void)
void
TclpMasterLock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_lock(&masterLock);
#endif
}
@@ -351,7 +351,7 @@ TclpMasterLock(void)
void
TclpMasterUnlock(void)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
pthread_mutex_unlock(&masterLock);
#endif
}
@@ -378,7 +378,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
@@ -386,7 +386,7 @@ Tcl_GetAllocMutex(void)
#endif
}
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
/*
*----------------------------------------------------------------------
@@ -659,7 +659,7 @@ char *
TclpInetNtoa(
struct in_addr addr)
{
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
unsigned char *b = (unsigned char*) &addr.s_addr;
@@ -671,7 +671,7 @@ TclpInetNtoa(
}
#endif /* TCL_NO_DEPRECATED */
-#ifdef TCL_THREADS
+#if !defined(TCL_THREADS) || TCL_THREADS
/*
* Additions by AOL for specialized thread memory allocator.
*/