Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
6fabf8e9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
6fabf8e9
编写于
3月 30, 2022
作者:
wafwerar
提交者:
cpwu
3月 30, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-13759]<fix>: add pthread func.
上级
e8033a49
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
18 addition
and
0 deletion
+18
-0
include/os/osThread.h
include/os/osThread.h
+7
-0
include/os/osTime.h
include/os/osTime.h
+2
-0
source/os/src/osThread.c
source/os/src/osThread.c
+9
-0
未找到文件。
include/os/osThread.h
浏览文件 @
6fabf8e9
...
...
@@ -32,6 +32,9 @@ typedef pthread_once_t TdThreadOnce;
typedef
pthread_rwlockattr_t
TdThreadRwlockAttr
;
typedef
pthread_cond_t
TdThreadCond
;
typedef
pthread_condattr_t
TdThreadCondAttr
;
typedef
pthread_key_t
TdThreadKey
;
typedef
pthread_barrier_t
TdThreadBarrier
;
typedef
pthread_barrierattr_t
TdThreadBarrierAttr
;
#define taosThreadCleanupPush pthread_cleanup_push
#define taosThreadCleanupPop pthread_cleanup_pop
...
...
@@ -79,6 +82,7 @@ typedef pthread_condattr_t TdThreadCondAttr;
#define pthread_sigmask PTHREAD_SIGMASK_FUNC_TAOS_FORBID
#define pthread_cancel PTHREAD_CANCEL_FUNC_TAOS_FORBID
#define pthread_kill PTHREAD_KILL_FUNC_TAOS_FORBID
#define pthread_setname_np PTHREAD_SETNAME_FUNC_TAOS_FORBID
#endif
int32_t
taosThreadSpinInit
(
TdThreadSpinlock
*
lock
,
int
pshared
);
...
...
@@ -86,6 +90,7 @@ int32_t taosThreadMutexInit(TdThreadMutex *mutex, const TdThreadMutexAttr *attr)
int32_t
taosThreadSpinDestroy
(
TdThreadSpinlock
*
lock
);
int32_t
taosThreadMutexDestroy
(
TdThreadMutex
*
mutex
);
int32_t
taosThreadSpinLock
(
TdThreadSpinlock
*
lock
);
int32_t
taosThreadSpinTryLock
(
TdThreadSpinlock
*
lock
);
int32_t
taosThreadMutexLock
(
TdThreadMutex
*
mutex
);
int32_t
taosThreadRwlockRdlock
(
TdThreadRwlock
*
rwlock
);
int32_t
taosThreadSpinUnlock
(
TdThreadSpinlock
*
lock
);
...
...
@@ -111,6 +116,8 @@ int32_t taosThreadEqual(TdThread t1, TdThread t2);
int32_t
taosThreadSigmask
(
int
how
,
sigset_t
const
*
set
,
sigset_t
*
oset
);
int32_t
taosThreadCancel
(
TdThread
thread
);
int32_t
taosThreadKill
(
TdThread
thread
,
int
sig
);
int32_t
taosThreadDetach
(
TdThread
thread
);
#ifdef __cplusplus
}
#endif
...
...
include/os/osTime.h
浏览文件 @
6fabf8e9
...
...
@@ -20,6 +20,8 @@
extern
"C"
{
#endif
#include <time.h>
// If the error is in a third-party library, place this header file under the third-party library header file.
// When you want to use this feature, you should find or add the same function in the following section.
#ifndef ALLOW_FORBID_FUNC
...
...
source/os/src/osThread.c
浏览文件 @
6fabf8e9
...
...
@@ -14,6 +14,7 @@
*/
#define ALLOW_FORBID_FUNC
#include <pthread.h>
#include "os.h"
// int32_t taosThreadSetnameNp(TdThread thread, const char *name) {
...
...
@@ -40,6 +41,10 @@ int32_t taosThreadSpinLock(TdThreadSpinlock *lock) {
return
pthread_spin_lock
(
lock
);
}
int32_t
taosThreadSpinTryLock
(
TdThreadSpinlock
*
lock
)
{
return
pthread_spin_trylock
(
lock
);
}
int32_t
taosThreadMutexLock
(
TdThreadMutex
*
mutex
)
{
return
pthread_mutex_lock
(
mutex
);
}
...
...
@@ -142,4 +147,8 @@ int32_t taosThreadCancel(TdThread thread) {
int32_t
taosThreadKill
(
TdThread
thread
,
int
sig
)
{
return
pthread_kill
(
thread
,
sig
);
}
int32_t
taosThreadDetach
(
TdThread
thread
)
{
return
pthread_detach
(
thread
);
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录