diff --git a/src/c11/impl/threads_posix.c b/src/c11/impl/threads_posix.c index 736fc587be2..f8ebbab5cec 100644 --- a/src/c11/impl/threads_posix.c +++ b/src/c11/impl/threads_posix.c @@ -177,10 +177,9 @@ mtx_init(mtx_t *mtx, int type) { pthread_mutexattr_t attr; assert(mtx != NULL); - if (type != mtx_plain && type != mtx_timed && type != mtx_try + if (type != mtx_plain && type != mtx_timed && type != (mtx_plain|mtx_recursive) - && type != (mtx_timed|mtx_recursive) - && type != (mtx_try|mtx_recursive)) + && type != (mtx_timed|mtx_recursive)) return thrd_error; if ((type & mtx_recursive) == 0) { diff --git a/src/c11/impl/threads_win32.c b/src/c11/impl/threads_win32.c index 67aa29e48ac..af2add0839f 100644 --- a/src/c11/impl/threads_win32.c +++ b/src/c11/impl/threads_win32.c @@ -266,10 +266,9 @@ int mtx_init(mtx_t *mtx, int type) { assert(mtx != NULL); - if (type != mtx_plain && type != mtx_timed && type != mtx_try + if (type != mtx_plain && type != mtx_timed && type != (mtx_plain|mtx_recursive) - && type != (mtx_timed|mtx_recursive) - && type != (mtx_try|mtx_recursive)) + && type != (mtx_timed|mtx_recursive)) return thrd_error; InitializeCriticalSection((PCRITICAL_SECTION)mtx); return thrd_success; diff --git a/src/c11/threads.h b/src/c11/threads.h index ac6902f3b02..c091d22b5bc 100644 --- a/src/c11/threads.h +++ b/src/c11/threads.h @@ -133,9 +133,8 @@ typedef pthread_once_t once_flag; enum { mtx_plain = 0, - mtx_try = 1, + mtx_recursive = 1, mtx_timed = 2, - mtx_recursive = 4 }; enum