summaryrefslogtreecommitdiffstats
path: root/unix/tclSelectNotfy.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 /unix/tclSelectNotfy.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 'unix/tclSelectNotfy.c')
-rw-r--r--unix/tclSelectNotfy.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/unix/tclSelectNotfy.c b/unix/tclSelectNotfy.c
index 3172d6a..58dc742 100644
--- a/unix/tclSelectNotfy.c
+++ b/unix/tclSelectNotfy.c
@@ -11,7 +11,7 @@
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*/
-#if (!defined(NOTIFIER_EPOLL) && !defined(NOTIFIER_KQUEUE)) || (defined(TCL_THREADS) && !TCL_THREADS)
+#if (!defined(NOTIFIER_EPOLL) && !defined(NOTIFIER_KQUEUE)) || !TCL_THREADS
#include "tclInt.h"
#ifndef HAVE_COREFOUNDATION /* Darwin/Mac OS X CoreFoundation notifier is
@@ -81,7 +81,7 @@ typedef struct ThreadSpecificData {
int numFdBits; /* Number of valid bits in checkMasks (one
* more than highest fd for which
* Tcl_WatchFile has been called). */
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
int onList; /* True if it is in this list */
unsigned int pollState; /* pollState is used to implement a polling
* handshake between each thread and the
@@ -112,7 +112,7 @@ typedef struct ThreadSpecificData {
static Tcl_ThreadDataKey dataKey;
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
/*
* The following static indicates the number of threads that have initialized
* notifiers.
@@ -193,7 +193,7 @@ static Tcl_ThreadId notifierThread;
* Static routines defined in this file.
*/
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
static TCL_NORETURN void NotifierThreadProc(ClientData clientData);
#if defined(HAVE_PTHREAD_ATFORK)
static int atForkInit = 0;
@@ -285,7 +285,7 @@ Tcl_InitNotifier(void)
} else {
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
tsdPtr->eventReady = 0;
/*
@@ -370,7 +370,7 @@ Tcl_FinalizeNotifier(
tclNotifierHooks.finalizeNotifierProc(clientData);
return;
} else {
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey);
pthread_mutex_lock(&notifierInitMutex);
@@ -640,7 +640,7 @@ Tcl_WaitForEvent(
FileHandler *filePtr;
int mask;
Tcl_Time vTime;
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
int waitForFiles;
# ifdef __CYGWIN__
MSG msg;
@@ -675,7 +675,7 @@ Tcl_WaitForEvent(
tclScaleTimeProcPtr(&vTime, tclTimeClientData);
timePtr = &vTime;
}
-#if defined(TCL_THREADS) && !TCL_THREADS
+#if !TCL_THREADS
timeout.tv_sec = timePtr->sec;
timeout.tv_usec = timePtr->usec;
timeoutPtr = &timeout;
@@ -694,7 +694,7 @@ Tcl_WaitForEvent(
#endif /* !TCL_THREADS */
}
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
/*
* Start notifier thread and place this thread on the list of
* interested threads, signal the notifier thread, and wait for a
@@ -885,14 +885,14 @@ Tcl_WaitForEvent(
}
filePtr->readyMask = mask;
}
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
pthread_mutex_unlock(&notifierMutex);
#endif /* TCL_THREADS */
return 0;
}
}
-#if !defined(TCL_THREADS) || TCL_THREADS
+#if TCL_THREADS
/*
*----------------------------------------------------------------------