summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoraspect <aspect+tclcore@abstracted-spleen.org>2016-12-06 21:52:29 (GMT)
committeraspect <aspect+tclcore@abstracted-spleen.org>2016-12-06 21:52:29 (GMT)
commit3b2ac99ea6a1d0729fe4ccdbbb9ff2535197f4d7 (patch)
tree15f3f330628000955fb3b4fd496cfe637b614a8d
parent7e78c42dd32421a8e999058aea557e259d299f2b (diff)
downloadtcl-bug_f4f44174e.zip
tcl-bug_f4f44174e.tar.gz
tcl-bug_f4f44174e.tar.bz2
move pthread_sigmask() calls to Tcl_WaitForEvent() where they belongbug_f4f44174e
-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;
}