rbb 99/10/12 12:21:11
Modified: src/lib/apr/locks/unix intraproc.c Log: Fix some locking problems in the original pthreads locking code. Some of this was me being overly cautious. Some of it was me being careless. :) Revision Changes Path 1.6 +2 -7 apache-2.0/src/lib/apr/locks/unix/intraproc.c Index: intraproc.c =================================================================== RCS file: /home/cvs/apache-2.0/src/lib/apr/locks/unix/intraproc.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- intraproc.c 1999/10/12 13:09:31 1.5 +++ intraproc.c 1999/10/12 19:21:10 1.6 @@ -63,10 +63,7 @@ ap_status_t lock_intra_cleanup(void *data) { struct lock_t *lock = (struct lock_t *) data; - if (lock->curr_locked == 1) { - return pthread_mutex_unlock(lock->intraproc); - } - return APR_SUCCESS; + return pthread_mutex_unlock(lock->intraproc); } ap_status_t create_intra_lock(struct lock_t *new) @@ -89,7 +86,7 @@ return stat; } - if ((stat = pthread_mutex_destroy(new->intraproc))) { + if ((stat = pthread_mutexattr_destroy(&mattr))) { lock_intra_cleanup(new); return stat; } @@ -102,7 +99,6 @@ ap_status_t lock_intra(struct lock_t *lock) { - lock->curr_locked = 1; return pthread_mutex_lock(lock->intraproc); } @@ -111,7 +107,6 @@ ap_status_t status; status = pthread_mutex_unlock(lock->intraproc); - lock->curr_locked = 0; return status; }