diff options
author | Keith Bostic <keith@wiredtiger.com> | 2015-08-19 13:04:08 -0400 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2015-08-19 13:04:08 -0400 |
commit | dda66ee36a8c6a508d8de57be3b956604cdc0025 (patch) | |
tree | 579b9f30cfb0b1c6d44a17e07e588f4aeb4f7c9d /src/os_posix | |
parent | f12fe888fc6cb783e91e3c53c7eaab7a991b0c5c (diff) | |
parent | ada57c1ed44ab0dd4f904f60a63bbc77333b2baa (diff) | |
download | mongo-dda66ee36a8c6a508d8de57be3b956604cdc0025.tar.gz |
Merge branch 'develop' into wt-1967-evict-any
Diffstat (limited to 'src/os_posix')
-rw-r--r-- | src/os_posix/os_mtx_cond.c | 6 | ||||
-rw-r--r-- | src/os_posix/os_mtx_rw.c | 10 | ||||
-rw-r--r-- | src/os_posix/os_open.c | 4 |
3 files changed, 10 insertions, 10 deletions
diff --git a/src/os_posix/os_mtx_cond.c b/src/os_posix/os_mtx_cond.c index dfd72dd0cd2..baf9b475777 100644 --- a/src/os_posix/os_mtx_cond.c +++ b/src/os_posix/os_mtx_cond.c @@ -54,7 +54,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs) locked = 0; /* Fast path if already signalled. */ - if (WT_ATOMIC_ADD4(cond->waiters, 1) == 0) + if (__wt_atomic_addi32(&cond->waiters, 1) == 0) return (0); /* @@ -91,7 +91,7 @@ __wt_cond_wait(WT_SESSION_IMPL *session, WT_CONDVAR *cond, uint64_t usecs) ret == ETIMEDOUT) ret = 0; - (void)WT_ATOMIC_SUB4(cond->waiters, 1); + (void)__wt_atomic_subi32(&cond->waiters, 1); err: if (locked) WT_TRET(pthread_mutex_unlock(&cond->mtx)); @@ -124,7 +124,7 @@ __wt_cond_signal(WT_SESSION_IMPL *session, WT_CONDVAR *cond) if (cond->waiters == -1) return (0); - if (cond->waiters > 0 || !WT_ATOMIC_CAS4(cond->waiters, 0, -1)) { + if (cond->waiters > 0 || !__wt_atomic_casi32(&cond->waiters, 0, -1)) { WT_ERR(pthread_mutex_lock(&cond->mtx)); locked = 1; WT_ERR(pthread_cond_broadcast(&cond->cond)); diff --git a/src/os_posix/os_mtx_rw.c b/src/os_posix/os_mtx_rw.c index df558b12bef..d47ab197643 100644 --- a/src/os_posix/os_mtx_rw.c +++ b/src/os_posix/os_mtx_rw.c @@ -165,7 +165,7 @@ __wt_try_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * incrementing the reader value to match it. */ new.s.readers = new.s.users = old.s.users + 1; - return (WT_ATOMIC_CAS8(l->u, old.u, new.u) ? 0 : EBUSY); + return (__wt_atomic_cas64(&l->u, old.u, new.u) ? 0 : EBUSY); } /* @@ -190,7 +190,7 @@ __wt_readlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * value will wrap and two lockers will simultaneously be granted the * lock. */ - ticket = WT_ATOMIC_FETCH_ADD2(l->s.users, 1); + ticket = __wt_atomic_fetch_add16(&l->s.users, 1); for (pause_cnt = 0; ticket != l->s.readers;) { /* * We failed to get the lock; pause before retrying and if we've @@ -234,7 +234,7 @@ __wt_readunlock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * Increment the writers value (other readers are doing the same, make * sure we don't race). */ - WT_ATOMIC_ADD2(l->s.writers, 1); + (void)__wt_atomic_add16(&l->s.writers, 1); return (0); } @@ -267,7 +267,7 @@ __wt_try_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) /* The replacement lock value is a result of allocating a new ticket. */ ++new.s.users; - return (WT_ATOMIC_CAS8(l->u, old.u, new.u) ? 0 : EBUSY); + return (__wt_atomic_cas64(&l->u, old.u, new.u) ? 0 : EBUSY); } /* @@ -292,7 +292,7 @@ __wt_writelock(WT_SESSION_IMPL *session, WT_RWLOCK *rwlock) * value will wrap and two lockers will simultaneously be granted the * lock. */ - ticket = WT_ATOMIC_FETCH_ADD2(l->s.users, 1); + ticket = __wt_atomic_fetch_add16(&l->s.users, 1); for (pause_cnt = 0; ticket != l->s.writers;) { /* * We failed to get the lock; pause before retrying and if we've diff --git a/src/os_posix/os_open.c b/src/os_posix/os_open.c index e442748fa43..ef4662aa369 100644 --- a/src/os_posix/os_open.c +++ b/src/os_posix/os_open.c @@ -177,7 +177,7 @@ setupfh: } if (!matched) { WT_CONN_FILE_INSERT(conn, fh, bucket); - (void)WT_ATOMIC_ADD4(conn->open_file_count, 1); + (void)__wt_atomic_add32(&conn->open_file_count, 1); *fhp = fh; } __wt_spin_unlock(session, &conn->fh_lock); @@ -224,7 +224,7 @@ __wt_close(WT_SESSION_IMPL *session, WT_FH **fhp) /* Remove from the list. */ bucket = fh->name_hash % WT_HASH_ARRAY_SIZE; WT_CONN_FILE_REMOVE(conn, fh, bucket); - (void)WT_ATOMIC_SUB4(conn->open_file_count, 1); + (void)__wt_atomic_sub32(&conn->open_file_count, 1); __wt_spin_unlock(session, &conn->fh_lock); |