 |
NEURON
|
Go to the documentation of this file. 4 #include <nrnpthread.h> 14 #define MUTDEC pthread_mutex_t* mut_; 15 #define MUTCONSTRUCTED (mut_ != (pthread_mutex_t*)0) 16 #if defined(__cplusplus) 17 #define MUTCONSTRUCT(mkmut) {if (mkmut) {mut_ = new pthread_mutex_t; pthread_mutex_init(mut_, 0);}else{mut_ = 0;}} 18 #define MUTDESTRUCT {if (mut_){pthread_mutex_destroy(mut_); delete mut_; mut_ = (pthread_mutex_t*)0;}} 20 #define MUTCONSTRUCT(mkmut) {if (mkmut) {mut_ = (pthread_mutex_t*)malloc(sizeof(pthread_mutex_t)); pthread_mutex_init(mut_, 0);}else{mut_ = 0;}} 21 #define MUTDESTRUCT {if (mut_){pthread_mutex_destroy(mut_); free(mut_); mut_ = NULL;}} 23 #define MUTLOCK {if (mut_) {pthread_mutex_lock(mut_);}} 24 #define MUTUNLOCK {if (mut_) {pthread_mutex_unlock(mut_);}} 29 #define MUTCONSTRUCTED (0) 30 #define MUTCONSTRUCT(mkmut)