int __gthread_once (__gthread_once_t *guard, void (*func)(void)) { if (guard->done) return 0; #ifdef __RTP__ __gthread_lock_library (); #else while (!vxTas ((void *)&guard->busy)) taskDelay (1); #endif /* Only one thread at a time gets here. Check ->done again, then go ahead and call func() if no one has done it yet. */ if (!guard->done) { func (); guard->done = 1; } #ifdef __RTP__ __gthread_unlock_library (); #else guard->busy = 0; #endif return 0; }
BOOL sysBusTas ( char *adrs /* address to be tested-and-set */ ) { return (vxTas(adrs)); }