diff options
author | fvogel <fvogelnew1@free.fr> | 2016-03-21 21:32:29 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2016-03-21 21:32:29 (GMT) |
commit | 3b21ae36fc18189a6cc850c1db2dc0e93e7129b6 (patch) | |
tree | cbcb9fac8b6662a217fd223f5504c2c2315ed447 /unix/tclUnixThrd.c | |
parent | addefaba01a0a32c7659cd2ae09bd805957cc800 (diff) | |
parent | 349c1fd2676793625cc0037a11d5989b0a591397 (diff) | |
download | tcl-bug_f1253530cd.zip tcl-bug_f1253530cd.tar.gz tcl-bug_f1253530cd.tar.bz2 |
Merged trunkbug_f1253530cd
Diffstat (limited to 'unix/tclUnixThrd.c')
-rw-r--r-- | unix/tclUnixThrd.c | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/unix/tclUnixThrd.c b/unix/tclUnixThrd.c index ea03332..554a2dc 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -44,13 +44,6 @@ static pthread_mutex_t initLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t allocLock = PTHREAD_MUTEX_INITIALIZER; static pthread_mutex_t *allocLockPtr = &allocLock; -/* - * These are for the critical sections inside this file. - */ - -#define MASTER_LOCK pthread_mutex_lock(&masterLock) -#define MASTER_UNLOCK pthread_mutex_unlock(&masterLock) - #endif /* TCL_THREADS */ /* @@ -252,7 +245,7 @@ TclpInitLock(void) /* *---------------------------------------------------------------------- * - * TclpFinalizeLock + * TclFinalizeLock * * This procedure is used to destroy all private resources used in this * file. @@ -421,7 +414,7 @@ Tcl_MutexLock( pthread_mutex_t *pmutexPtr; if (*mutexPtr == NULL) { - MASTER_LOCK; + pthread_mutex_lock(&masterLock); if (*mutexPtr == NULL) { /* * Double inside master lock check to avoid a race condition. @@ -432,7 +425,7 @@ Tcl_MutexLock( *mutexPtr = (Tcl_Mutex)pmutexPtr; TclRememberMutex(mutexPtr); } - MASTER_UNLOCK; + pthread_mutex_unlock(&masterLock); } pmutexPtr = *((pthread_mutex_t **)mutexPtr); pthread_mutex_lock(pmutexPtr); @@ -529,7 +522,7 @@ Tcl_ConditionWait( struct timespec ptime; if (*condPtr == NULL) { - MASTER_LOCK; + pthread_mutex_lock(&masterLock); /* * Double check inside mutex to avoid race, then initialize condition @@ -542,7 +535,7 @@ Tcl_ConditionWait( *condPtr = (Tcl_Condition) pcondPtr; TclRememberCondition(condPtr); } - MASTER_UNLOCK; + pthread_mutex_unlock(&masterLock); } pmutexPtr = *((pthread_mutex_t **)mutexPtr); pcondPtr = *((pthread_cond_t **)condPtr); |