forked from 0ad/0ad
ONCE macro thread secured
This was SVN commit r56.
This commit is contained in:
parent
e2a65abe1b
commit
3dfeb3e5f8
@ -38,9 +38,7 @@
|
||||
|
||||
#define UNUSED(param) (void)param;
|
||||
|
||||
#define ONCE(code) { static bool done; if(!done) { code; }; done = true; }
|
||||
|
||||
|
||||
#define ONCE(code) { pthread_mutex_t mutex=PTHREAD_MUTEX_INITIALIZER; if(pthread_mutex_trylock(&(mutex))==0) { code; } }
|
||||
|
||||
|
||||
template<bool>
|
||||
|
Loading…
Reference in New Issue
Block a user