diff options
author | rpj <rpj> | 2001-07-05 17:04:39 +0000 |
---|---|---|
committer | rpj <rpj> | 2001-07-05 17:04:39 +0000 |
commit | 7a3104dc65b469cbb9c88b6a9c7b7bea4126a43e (patch) | |
tree | 524cc0af0d3fa262c2412cdda269185059b33c33 /rwlock.c | |
parent | ec27b9c8303540de6b5a8ebefee114f3cdd436f0 (diff) |
Fixups to last commit.
Diffstat (limited to 'rwlock.c')
-rw-r--r-- | rwlock.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -383,16 +383,13 @@ pthread_rwlock_wrlock(pthread_rwlock_t * rwlock) * so temporarily prevent pthread_cond_wait() from being one. */ pthread_t self = pthread_self(); - int cancelType = pthread_getcanceltype(self); int oldCancelState; rwl->nCompletedSharedAccessCount = -rwl->nSharedAccessCount; - if (cancelType == PTHREAD_CANCEL_DEFERRED) + if (self->cancelType == PTHREAD_CANCEL_DEFERRED) { - oldCancelState = - pthread_setcancelstate(self, - PTHREAD_CANCEL_DISABLED); + pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, &oldCancelState); } /* Could still be PTHREAD_CANCEL_ASYNCHRONOUS. */ @@ -405,9 +402,9 @@ pthread_rwlock_wrlock(pthread_rwlock_t * rwlock) } while (result == 0 && rwl->nCompletedSharedAccessCount < 0); - if (cancelType == PTHREAD_CANCEL_DEFERRED) + if (self->cancelType == PTHREAD_CANCEL_DEFERRED) { - pthread_setcancelstate(self, oldCancelState); + pthread_setcancelstate(oldCancelState, NULL); } pthread_cleanup_pop ((result != 0) ? 1 : 0); |