summaryrefslogtreecommitdiffstats
path: root/include/jemalloc/internal/mutex.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/jemalloc/internal/mutex.h')
-rw-r--r--include/jemalloc/internal/mutex.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/jemalloc/internal/mutex.h b/include/jemalloc/internal/mutex.h
index 7d19a0f..581aaf5 100644
--- a/include/jemalloc/internal/mutex.h
+++ b/include/jemalloc/internal/mutex.h
@@ -81,7 +81,8 @@ malloc_mutex_lock(tsd_t *tsd, malloc_mutex_t *mutex)
{
if (isthreaded) {
- witness_assert_not_owner(tsd, &mutex->witness);
+ if (config_debug)
+ witness_assert_not_owner(tsd, &mutex->witness);
#ifdef _WIN32
# if _WIN32_WINNT >= 0x0600
AcquireSRWLockExclusive(&mutex->lock);
@@ -103,7 +104,6 @@ malloc_mutex_unlock(tsd_t *tsd, malloc_mutex_t *mutex)
{
if (isthreaded) {
- witness_assert_owner(tsd, &mutex->witness);
if (config_debug)
witness_unlock(tsd, &mutex->witness);
#ifdef _WIN32