ONCE macro thread secured

This was SVN commit r56.
This commit is contained in:
Simon Brenner 2003-11-13 15:14:23 +00:00
parent e2a65abe1b
commit 3dfeb3e5f8

View File

@ -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>