diff options
| author | rpj <rpj> | 2001-12-20 15:23:01 +0000 | 
|---|---|---|
| committer | rpj <rpj> | 2001-12-20 15:23:01 +0000 | 
| commit | 6f68e7b50e0bb837d02dc2cb8a7bc5887534d7b8 (patch) | |
| tree | 04da814e68189b6479baa59f34500f6df63e6242 | |
| parent | c144e755b6008df26733c28905311a68b6b5afe5 (diff) | |
	* mutex.c (pthread_mutex_lock): Decrementing lock_idx was
	not thread-safe.
	(pthread_mutex_trylock): Likewise.
| -rw-r--r-- | ChangeLog | 8 | ||||
| -rw-r--r-- | mutex.c | 5 | 
2 files changed, 11 insertions, 2 deletions
@@ -1,3 +1,11 @@ +2001-12-21  Ross Johnson  <rpj@special.ise.canberra.edu.au> + +	Contributed by - Alexander Terekhov <TEREKHOV@de.ibm.com> +	 +	* mutex.c (pthread_mutex_lock): Decrementing lock_idx was +	not thread-safe. +	(pthread_mutex_trylock): Likewise. +  2001-10-26  Ross Johnson  <rpj@special.ise.canberra.edu.au>  	Reported by -  prionx@juno.com @@ -650,7 +650,7 @@ pthread_mutex_lock(pthread_mutex_t *mutex)        if( mx->kind != PTHREAD_MUTEX_FAST_NP &&            pthread_equal( mx->ownerThread, pthread_self() ) )  	{ -          mx->lock_idx--; +          (void) InterlockedDecrement( &mx->lock_idx );            if( mx->kind == PTHREAD_MUTEX_RECURSIVE_NP )              { @@ -766,7 +766,7 @@ pthread_mutex_trylock(pthread_mutex_t *mutex)  	    }            else              { -              mx->lock_idx--; +              (void) InterlockedDecrement( &mx->lock_idx );                result = EBUSY;              } @@ -780,3 +780,4 @@ pthread_mutex_trylock(pthread_mutex_t *mutex)    return(result);  } +  | 
