summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixNotfy.c
diff options
context:
space:
mode:
Diffstat (limited to 'unix/tclUnixNotfy.c')
-rw-r--r--unix/tclUnixNotfy.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/unix/tclUnixNotfy.c b/unix/tclUnixNotfy.c
index 6260cf6..255ee3b 100644
--- a/unix/tclUnixNotfy.c
+++ b/unix/tclUnixNotfy.c
@@ -491,13 +491,8 @@ Tcl_AlertNotifier(
return;
} else {
#ifdef TCL_THREADS
- sigset_t sigset, oldset;
ThreadSpecificData *tsdPtr = clientData;
- /* block signals while we're holding the mutex */
- sigfillset(&sigset);
- pthread_sigmask(SIG_BLOCK, &sigset, &oldset);
-
pthread_mutex_lock(&notifierMutex);
tsdPtr->eventReady = 1;
@@ -508,9 +503,6 @@ Tcl_AlertNotifier(
# endif /* __CYGWIN__ */
pthread_mutex_unlock(&notifierMutex);
- /* unblock signals */
- pthread_sigmask(SIG_SETMASK, &oldset, NULL);
-
#endif /* TCL_THREADS */
}
}
@@ -873,6 +865,7 @@ Tcl_WaitForEvent(
Tcl_Time vTime;
#ifdef TCL_THREADS
int waitForFiles;
+ sigset_t sigset, oldset;
# ifdef __CYGWIN__
MSG msg;
# endif /* __CYGWIN__ */
@@ -933,6 +926,9 @@ Tcl_WaitForEvent(
*/
StartNotifierThread("Tcl_WaitForEvent");
+ /* block signals while we're holding the mutex */
+ sigfillset(&sigset);
+ pthread_sigmask(SIG_BLOCK, &sigset, &oldset);
pthread_mutex_lock(&notifierMutex);
if (timePtr != NULL && timePtr->sec == 0 && (timePtr->usec == 0
@@ -1118,6 +1114,8 @@ Tcl_WaitForEvent(
}
#ifdef TCL_THREADS
pthread_mutex_unlock(&notifierMutex);
+ /* unblock signals */
+ pthread_sigmask(SIG_SETMASK, &oldset, NULL);
#endif /* TCL_THREADS */
return 0;
}