GUI: Fix Tomato RAF theme for all builds. Compilation typo.
[tomato.git] / release / src-rt-6.x.4708 / tools / misc / xz / src / common / mythread.h
blob476c2fc9e103da6f1c3e5d462715ff2009c29e2a
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file mythread.h
4 /// \brief Wrappers for threads
5 //
6 // Author: Lasse Collin
7 //
8 // This file has been put into the public domain.
9 // You can do whatever you want with this file.
11 ///////////////////////////////////////////////////////////////////////////////
13 #include "sysdefs.h"
16 #ifdef HAVE_PTHREAD
17 # include <pthread.h>
19 # define mythread_once(func) \
20 do { \
21 static pthread_once_t once_ = PTHREAD_ONCE_INIT; \
22 pthread_once(&once_, &func); \
23 } while (0)
25 # define mythread_sigmask(how, set, oset) \
26 pthread_sigmask(how, set, oset)
28 #else
30 # define mythread_once(func) \
31 do { \
32 static bool once_ = false; \
33 if (!once_) { \
34 func(); \
35 once_ = true; \
36 } \
37 } while (0)
39 # define mythread_sigmask(how, set, oset) \
40 sigprocmask(how, set, oset)
42 #endif