diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-03-21 12:10:23 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2016-03-21 12:10:23 (GMT) |
commit | de842a4b05d1fb570c8da02170a84c77f95c04a5 (patch) | |
tree | a786f1dc9fa6b1a03ac71a1ccdbfc2b6f5165e82 /unix/tclUnixThrd.c | |
parent | c2bbf3cc3a6c2c35b0911def8f5759e4e0307053 (diff) | |
parent | a2827884a964758c13230c45ba18fa131cabbb8d (diff) | |
download | tcl-de842a4b05d1fb570c8da02170a84c77f95c04a5.zip tcl-de842a4b05d1fb570c8da02170a84c77f95c04a5.tar.gz tcl-de842a4b05d1fb570c8da02170a84c77f95c04a5.tar.bz2 |
merge trunk
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 2440a98..ca3db3e 100644 --- a/unix/tclUnixThrd.c +++ b/unix/tclUnixThrd.c @@ -38,13 +38,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 */ /* @@ -246,7 +239,7 @@ TclpInitLock(void) /* *---------------------------------------------------------------------- * - * TclpFinalizeLock + * TclFinalizeLock * * This procedure is used to destroy all private resources used in this * file. @@ -415,7 +408,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. @@ -426,7 +419,7 @@ Tcl_MutexLock( *mutexPtr = (Tcl_Mutex)pmutexPtr; TclRememberMutex(mutexPtr); } - MASTER_UNLOCK; + pthread_mutex_unlock(&masterLock); } pmutexPtr = *((pthread_mutex_t **)mutexPtr); pthread_mutex_lock(pmutexPtr); @@ -523,7 +516,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 @@ -536,7 +529,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); |