diff options
author | Jason Evans <jasone@canonware.com> | 2017-03-01 03:09:23 (GMT) |
---|---|---|
committer | Jason Evans <jasone@canonware.com> | 2017-03-01 03:09:23 (GMT) |
commit | 04380e79f1e2428bd0ad000bbc6e3d2dfc6b66a5 (patch) | |
tree | 85f88607465908a7b66ad70d4caca69a0836189f /include/jemalloc/internal/mutex.h | |
parent | f1f76357313e7dcad7262f17a48ff0a2e005fcdc (diff) | |
parent | 700253e1f2f40d4a74e361fa1e688986c361dba4 (diff) | |
download | jemalloc-4.5.0.zip jemalloc-4.5.0.tar.gz jemalloc-4.5.0.tar.bz2 |
Merge branch 'rc-4.5.0'4.5.0
Diffstat (limited to 'include/jemalloc/internal/mutex.h')
-rw-r--r-- | include/jemalloc/internal/mutex.h | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h index b442d2d..2b4b1c3 100644 --- a/include/jemalloc/internal/mutex.h +++ b/include/jemalloc/internal/mutex.h @@ -85,8 +85,8 @@ JEMALLOC_INLINE void malloc_mutex_lock(tsdn_t *tsdn, malloc_mutex_t *mutex) { + witness_assert_not_owner(tsdn, &mutex->witness); if (isthreaded) { - witness_assert_not_owner(tsdn, &mutex->witness); #ifdef _WIN32 # if _WIN32_WINNT >= 0x0600 AcquireSRWLockExclusive(&mutex->lock); @@ -100,16 +100,16 @@ malloc_mutex_lock(tsdn_t *tsdn, malloc_mutex_t *mutex) #else pthread_mutex_lock(&mutex->lock); #endif - witness_lock(tsdn, &mutex->witness); } + witness_lock(tsdn, &mutex->witness); } JEMALLOC_INLINE void malloc_mutex_unlock(tsdn_t *tsdn, malloc_mutex_t *mutex) { + witness_unlock(tsdn, &mutex->witness); if (isthreaded) { - witness_unlock(tsdn, &mutex->witness); #ifdef _WIN32 # if _WIN32_WINNT >= 0x0600 ReleaseSRWLockExclusive(&mutex->lock); @@ -130,16 +130,14 @@ JEMALLOC_INLINE void malloc_mutex_assert_owner(tsdn_t *tsdn, malloc_mutex_t *mutex) { - if (isthreaded) - witness_assert_owner(tsdn, &mutex->witness); + witness_assert_owner(tsdn, &mutex->witness); } JEMALLOC_INLINE void malloc_mutex_assert_not_owner(tsdn_t *tsdn, malloc_mutex_t *mutex) { - if (isthreaded) - witness_assert_not_owner(tsdn, &mutex->witness); + witness_assert_not_owner(tsdn, &mutex->witness); } #endif |