NEURON
nmodlmutex.h
Go to the documentation of this file.
1 #ifndef nmodlmutex_h
2 #define nmodlmutex_h
3 
4 #include <nrnpthread.h>
5 #if USE_PTHREAD
6 #include <pthread.h>
7 extern pthread_mutex_t* _nmodlmutex;
8 #define _NMODLMUTEXLOCK \
9  { \
10  if (_nmodlmutex) { \
11  pthread_mutex_lock(_nmodlmutex); \
12  } \
13  }
14 #define _NMODLMUTEXUNLOCK \
15  { \
16  if (_nmodlmutex) { \
17  pthread_mutex_unlock(_nmodlmutex); \
18  } \
19  }
20 #else
21 #define _NMODLMUTEXLOCK /**/
22 #define _NMODLMUTEXUNLOCK /**/
23 #endif
24 
25 #endif