mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-07-23 21:23:06 +00:00
@@ -9,7 +9,7 @@ mtx_init(mtx_t *mtx) {
|
||||
#ifdef _WIN32
|
||||
if (!InitializeCriticalSectionAndSpinCount(&mtx->lock,
|
||||
_CRT_SPINCOUNT)) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
#elif (defined(JEMALLOC_OS_UNFAIR_LOCK))
|
||||
mtx->lock = OS_UNFAIR_LOCK_INIT;
|
||||
@@ -19,16 +19,16 @@ mtx_init(mtx_t *mtx) {
|
||||
pthread_mutexattr_t attr;
|
||||
|
||||
if (pthread_mutexattr_init(&attr) != 0) {
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_DEFAULT);
|
||||
if (pthread_mutex_init(&mtx->lock, &attr) != 0) {
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
return (true);
|
||||
return true;
|
||||
}
|
||||
pthread_mutexattr_destroy(&attr);
|
||||
#endif
|
||||
return (false);
|
||||
return false;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user