From 1dde0f532f346c9382ef706a254861fd23eda12a Mon Sep 17 00:00:00 2001 From: rpj Date: Wed, 18 Jul 2001 14:00:56 +0000 Subject: * rwlock.c (pthread_rwlock_wrlock): Is allowed to be a cancelation point; re-enable deferred cancelability around the CV call. --- rwlock.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'rwlock.c') diff --git a/rwlock.c b/rwlock.c index 2cc94ce..7908ed3 100644 --- a/rwlock.c +++ b/rwlock.c @@ -378,21 +378,12 @@ pthread_rwlock_wrlock(pthread_rwlock_t * rwlock) if (rwl->nSharedAccessCount > 0) { - /* - * pthread_rwlock_wrlock() is not a cancelation point - * so temporarily prevent pthread_cond_wait() from being one. - */ - pthread_t self = pthread_self(); - int oldCancelState; - rwl->nCompletedSharedAccessCount = -rwl->nSharedAccessCount; - if (self->cancelType == PTHREAD_CANCEL_DEFERRED) - { - pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldCancelState); - } - - /* Could still be PTHREAD_CANCEL_ASYNCHRONOUS. */ + /* + * This routine may be a cancelation point + * according to POSIX 1003.1j section 18.1.2. + */ pthread_cleanup_push(ptw32_rwlock_cancelwrwait, (void*)rwl); do @@ -402,11 +393,6 @@ pthread_rwlock_wrlock(pthread_rwlock_t * rwlock) } while (result == 0 && rwl->nCompletedSharedAccessCount < 0); - if (self->cancelType == PTHREAD_CANCEL_DEFERRED) - { - pthread_setcancelstate(oldCancelState, NULL); - } - pthread_cleanup_pop ((result != 0) ? 1 : 0); if (result == 0) -- cgit v1.2.3