Avoid recursive lockups in threadOnce while still ensuring that a

preempting task does not incorrectly determine that the `init'
function has completed.
This commit is contained in:
W. Eric Norum
2000-03-01 23:47:19 +00:00
parent cb81dd020a
commit 6952fcffc0

View File

@@ -362,6 +362,7 @@ void threadOnceOsd(threadOnceId *id, void(*func)(void *), void *arg)
}
semMutexMustTake(onceMutex);
if (*id == 0) {
*id = -1;
func(arg);
*id = 1;
}