Skip to content

util: Use pthread to implement simple_mtx_t for MacOS or other possible posix platform

Yonggang Luo requested to merge lygstate/mesa:simple_mtx_by_pthread_macos into main

cc @alyssa @jenatali @jekstrand

MacOS doesn't support for futex, so implement simple_mtx_t on MacOS with pthread so that do not use c11/threads.h to implement simple_mtx_t that incur a penalty of _simple_mtx_plain_init_once. And with pthread, we have PTHREAD_MUTEX_INITIALIZER for SIMPLE_MTX_INITIALIZER that's more straightforward

Signed-off-by: Yonggang Luo luoyonggang@gmail.com

Edited by Yonggang Luo

Merge request reports