Index: thread/rthread_mutex.c =================================================================== RCS file: /cvs/src/lib/libc/thread/rthread_mutex.c,v diff -u -p -r1.6 rthread_mutex.c --- thread/rthread_mutex.c 20 Sep 2024 02:00:46 -0000 1.6 +++ thread/rthread_mutex.c 13 Jul 2025 01:14:52 -0000 @@ -43,7 +43,7 @@ enum { #define SPIN_WAIT() do { } while (0) #endif -static _atomic_lock_t static_init_lock = _SPINLOCK_UNLOCKED; +static struct __cmtx static_init_lock = __CMTX_INITIALIZER(); int pthread_mutex_init(pthread_mutex_t *mutexp, const pthread_mutexattr_t *attr) @@ -151,10 +151,10 @@ _rthread_mutex_timedlock(pthread_mutex_t * is NULL. */ if (*mutexp == NULL) { - _spinlock(&static_init_lock); + __cmtx_enter(&static_init_lock); if (*mutexp == NULL) error = pthread_mutex_init(mutexp, NULL); - _spinunlock(&static_init_lock); + __cmtx_leave(&static_init_lock); if (error != 0) return (EINVAL); }