mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
17 lines
451 B
C++
17 lines
451 B
C++
#include <Core/Core.h>
|
|
|
|
#define INTERLOCKED static StaticCriticalSection MK__s; CriticalSection::Lock COMBINE(MK__s, _lock)(MK__s)
|
|
|
|
#define INITLOCK \
|
|
static volatile bool init; \
|
|
if(!init) \
|
|
for(CriticalSection::LockMain __; !init; init = true) \
|
|
|
|
CONSOLE_APP_MAIN
|
|
{
|
|
for(static volatile bool b; !b;) \
|
|
for(static StaticCriticalSection section; !b;) \
|
|
for(CriticalSection::Lock lock(section); !b; b = true)
|
|
LOG("INIT!");
|
|
}
|
|
}
|