📄 mutex.cpp
字号:
#include "mutex.h"MyJmutex::MyJmutex(){ pthread_mutex_init(&mutex,NULL); pthread_cond_init(&cond,NULL);}MyJmutex::~MyJmutex(){ pthread_mutex_destroy(&mutex); pthread_cond_destroy(&cond);}void MyJmutex::lock(void){ pthread_mutex_lock(&mutex); }void MyJmutex::unlock(void){ pthread_mutex_unlock(&mutex);}void MyJmutex::signal(void){ pthread_cond_signal(&cond);}void MyJmutex::wait(void){ pthread_cond_wait(&cond,&mutex);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -