summaryrefslogtreecommitdiffstats
path: root/generic/tclThread.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2018-05-22 20:53:24 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2018-05-22 20:53:24 (GMT)
commitce025f259b91e61857e70c6690d5db631b5dc747 (patch)
treef175e43fb180d0b756186a839cbeee766ec8e27c /generic/tclThread.c
parentf6af18a9476f566a34901b828e33f7141266174c (diff)
downloadtcl-ce025f259b91e61857e70c6690d5db631b5dc747.zip
tcl-ce025f259b91e61857e70c6690d5db631b5dc747.tar.gz
tcl-ce025f259b91e61857e70c6690d5db631b5dc747.tar.bz2
Simplify usage of TCL_THREAD, along the lines of [eeddb0693a950be980a66de3811630a00c7bab54|eeddb0693a]. Suggested by DKF
Diffstat (limited to 'generic/tclThread.c')
-rw-r--r--generic/tclThread.c33
1 files changed, 9 insertions, 24 deletions
diff --git a/generic/tclThread.c b/generic/tclThread.c
index a70f1aa..8def429 100644
--- a/generic/tclThread.c
+++ b/generic/tclThread.c
@@ -41,21 +41,6 @@ static void RememberSyncObject(void *objPtr,
SyncObjRecord *recPtr);
/*
- * Several functions are #defined to nothing in tcl.h if TCL_THREADS is not
- * specified. Here we undo that so the functions are defined in the stubs
- * table.
- */
-
-#if defined(TCL_THREADS) && !TCL_THREADS
-#undef Tcl_MutexLock
-#undef Tcl_MutexUnlock
-#undef Tcl_MutexFinalize
-#undef Tcl_ConditionNotify
-#undef Tcl_ConditionWait
-#undef Tcl_ConditionFinalize
-#endif
-
-/*
*----------------------------------------------------------------------
*
* Tcl_GetThreadData --
@@ -79,7 +64,7 @@ Tcl_GetThreadData(
int size) /* Size of storage block */
{
void *result;
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
/*
* Initialize the key for this thread.
*/
@@ -126,7 +111,7 @@ TclThreadDataKeyGet(
Tcl_ThreadDataKey *keyPtr) /* Identifier for the data chunk. */
{
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
return TclThreadStorageKeyGet(keyPtr);
#else /* TCL_THREADS */
return *keyPtr;
@@ -273,7 +258,7 @@ void
Tcl_MutexFinalize(
Tcl_Mutex *mutexPtr)
{
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
TclpFinalizeMutex(mutexPtr);
#endif
TclpMasterLock();
@@ -326,7 +311,7 @@ void
Tcl_ConditionFinalize(
Tcl_Condition *condPtr)
{
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
TclpFinalizeCondition(condPtr);
#endif
TclpMasterLock();
@@ -356,7 +341,7 @@ void
TclFinalizeThreadData(int quick)
{
TclFinalizeThreadDataThread();
-#if (!defined(TCL_THREADS) || TCL_THREADS) && defined(USE_THREAD_ALLOC)
+#if TCL_THREADS && defined(USE_THREAD_ALLOC)
if (!quick) {
/*
* Quick exit principle makes it useless to terminate allocators
@@ -389,7 +374,7 @@ TclFinalizeSynchronization(void)
int i;
void *blockPtr;
Tcl_ThreadDataKey *keyPtr;
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
Tcl_Mutex *mutexPtr;
Tcl_Condition *condPtr;
@@ -413,7 +398,7 @@ TclFinalizeSynchronization(void)
keyRecord.max = 0;
keyRecord.num = 0;
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
/*
* Call thread storage master cleanup.
*/
@@ -473,12 +458,12 @@ Tcl_ExitThread(
int status)
{
Tcl_FinalizeThread();
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
TclpThreadExit(status);
#endif
}
-#if defined(TCL_THREADS) && !TCL_THREADS
+#if !TCL_THREADS
/*
*----------------------------------------------------------------------