From 6952fcffc09ff1c2afcf59f02c26fba88e7624fa Mon Sep 17 00:00:00 2001 From: "W. Eric Norum" Date: Wed, 1 Mar 2000 23:47:19 +0000 Subject: [PATCH] Avoid recursive lockups in threadOnce while still ensuring that a preempting task does not incorrectly determine that the `init' function has completed. --- src/libCom/osi/os/RTEMS/osdThread.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libCom/osi/os/RTEMS/osdThread.c b/src/libCom/osi/os/RTEMS/osdThread.c index 5959709df..ba19bfded 100644 --- a/src/libCom/osi/os/RTEMS/osdThread.c +++ b/src/libCom/osi/os/RTEMS/osdThread.c @@ -362,6 +362,7 @@ void threadOnceOsd(threadOnceId *id, void(*func)(void *), void *arg) } semMutexMustTake(onceMutex); if (*id == 0) { + *id = -1; func(arg); *id = 1; }