It was locked in S_ithread_create() - in case it returned a non-NULL thread.
Because of this conditionality the S_ithread_create() cannot be annotated.
threads.xs:1161:9: warning: releasing mutex 'thread->mutex' that was not held [-Wthread-safety-analysis]
MUTEX_UNLOCK(&thread->mutex);
/* Let thread run. */
/* See S_ithread_run() for more detail. */
+ CLANG_DIAG_IGNORE(-Wthread-safety);
+ /* warning: releasing mutex 'thread->mutex' that was not held [-Wthread-safety-analysis] */
MUTEX_UNLOCK(&thread->mutex);
+ CLANG_DIAG_RESTORE;
/* XSRETURN(1); - implied */