1 Star 4 Fork 7

SSZL博客 / iot_http_websoket_server

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
CMutex.cpp 731 Bytes
AI 代码解读
一键复制 编辑 原始数据 按行查看 历史
SSZL 提交于 2018-10-09 16:07 . 线程锁
/*************************************************************************
# > File Name: CMutex.cpp
# > Author: SSZL
# > Mail: sszllzss@foxmail.com
# > Blog: sszlbg.cn
# > Created Time: 2018-10-03 15:02:56
# > Revise Time: 2018-10-03 22:39:23
************************************************************************/
#include "CMutex.hpp"
#include<iostream>
CMutex::CMutex()
{
pthread_mutex_init(&this->_mutex,NULL);
}
CMutex::~CMutex()
{
pthread_mutex_destroy(&this->_mutex);
}
int32_t CMutex::lock()
{
return pthread_mutex_lock(&_mutex);
}
int32_t CMutex::unlock()
{
return pthread_mutex_unlock(&this->_mutex);
}
int32_t CMutex::trylock()
{
return pthread_mutex_trylock(&this->_mutex);
}
C++
1
https://gitee.com/sszl_blog/iot_http_websoket_server.git
git@gitee.com:sszl_blog/iot_http_websoket_server.git
sszl_blog
iot_http_websoket_server
iot_http_websoket_server
master

搜索帮助