Module: Mesa Branch: main Commit: eec1e728c5cde99e8cd61a49791dfd96e383a902 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=eec1e728c5cde99e8cd61a49791dfd96e383a902
Author: Yonggang Luo <[email protected]> Date: Tue Sep 6 23:59:50 2022 +0800 c11: Update the values of enum mtx_plain, mtx_recursive, mtx_timed to make sure mtx_recursive != mtx_plain | mtx_recursive According to c11 standards, there is 4 variant of mtx_init parameter, mtx_plain mtx_timed mtx_plain|mtx_recursive mtx_timed|mtx_recursive Directly use mtx_recursive is not a thing, so we need make sure mtx_plain and mtx_plain|mtx_recursive are not equal, So now we choose the values from Android c11 threads.h for enum mtx_plain, mtx_recursive, mtx_timed, to make sure c11/threads.h be more c11 conformance, and can raise error when the type parameter of mtx_init are not one of mtx_plain mtx_timed mtx_plain|mtx_recursive mtx_timed|mtx_recursive Signed-off-by: Yonggang Luo <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18445> --- src/c11/threads.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/c11/threads.h b/src/c11/threads.h index 146b7f5c174..fe9ad387fcd 100644 --- a/src/c11/threads.h +++ b/src/c11/threads.h @@ -146,9 +146,9 @@ typedef pthread_once_t once_flag; /*-------------------- enumeration constants --------------------*/ enum { - mtx_plain = 0, - mtx_recursive = 1, - mtx_timed = 2, + mtx_plain = 0x1, + mtx_recursive = 0x2, + mtx_timed = 0x4, }; enum
