1 #ifndef CTHREAD_DEBUG_H 2 #define CTHREAD_DEBUG_H 3 4 #include <mutex> 5 #include <condition_variable> 6 7 void Cthread_mutex_lock(const char *caller, std::mutex &p_mutex); 8 void Cthread_mutex_unlock(const char *caller, std::mutex &p_mutex); 9 10 void Cthread_cond_signal(const char *caller, std::condition_variable &p_cond_var); 11 void Cthread_cond_wait(const char *caller, std::condition_variable &p_cond_var, std::unique_lock<std::mutex> &p_mutex); 12 13 #define cthread_mutex_lock(a) Cthread_mutex_lock(__func__, a) 14 #define cthread_mutex_unlock(a) Cthread_mutex_unlock(__func__, a) 15 16 #define cthread_cond_signal(a) Cthread_cond_signal(__func__, a) 17 #define cthread_cond_wait(a, b) Cthread_cond_wait(__func__, a, b) 18 19 #endif /* CTHREAD_DEBUG_H */ 20