25#if defined(OF_HAVE_THREADS) && defined(OF_HAVE_ATOMIC_OPS)
31# define Class IntuitionClass
32# include <proto/exec.h>
37OFOnce(OFOnceControl *control,
void (*
function)(
void))
39#if !defined(OF_HAVE_THREADS)
44#elif defined(OF_HAVE_PTHREADS)
45 pthread_once(control,
function);
46#elif defined(OF_HAVE_ATOMIC_OPS)
51 if (OFAtomicIntCompareAndSwap(control, 0, 1)) {
56 OFAtomicIntIncrease(control);
60#elif defined(OF_AMIGAOS)
75 while (*control == 1) {
88# error No OFOnce available
void OFOnce(OFOnceControl *control, OFOnceFunction function)
Executes the specified function exactly once in the application's lifetime, even in a multi-threaded ...
Definition OFOnce.m:37
static OF_INLINE void OFYieldThread(void)
Yield the current thread, indicating to the OS that another thread should execute instead.
Definition OFPlainMutex.h:171