Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
caf1e0e8
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
caf1e0e8
编写于
3月 20, 2022
作者:
wafwerar
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-13759]<fix>: redefine thread api.
上级
2eb40c24
变更
18
隐藏空白更改
内联
并排
Showing
18 changed file
with
339 addition
and
116 deletion
+339
-116
include/os/os.h
include/os/os.h
+1
-2
include/os/osSemaphore.h
include/os/osSemaphore.h
+15
-16
include/os/osString.h
include/os/osString.h
+1
-1
include/os/osThread.h
include/os/osThread.h
+88
-0
include/os/osTimezone.h
include/os/osTimezone.h
+5
-0
source/libs/transport/test/uv.c
source/libs/transport/test/uv.c
+3
-4
source/os/src/osSemaphore.c
source/os/src/osSemaphore.c
+33
-34
source/os/src/osThread.c
source/os/src/osThread.c
+145
-0
source/os/src/osTimezone.c
source/os/src/osTimezone.c
+1
-0
source/util/CMakeLists.txt
source/util/CMakeLists.txt
+0
-4
source/util/test/trefTest.c
source/util/test/trefTest.c
+16
-17
tests/script/api/batchprepare.c
tests/script/api/batchprepare.c
+8
-9
tests/script/api/stmtBatchTest.c
tests/script/api/stmtBatchTest.c
+5
-6
tests/script/api/stmtTest.c
tests/script/api/stmtTest.c
+0
-1
tests/script/api/stmt_function.c
tests/script/api/stmt_function.c
+0
-1
tests/script/http/httpTest.c
tests/script/http/httpTest.c
+6
-7
tests/script/http/httpTestSqlUtc.c
tests/script/http/httpTestSqlUtc.c
+6
-7
tests/script/http/httpTestSqlt.c
tests/script/http/httpTestSqlt.c
+6
-7
未找到文件。
include/os/os.h
浏览文件 @
caf1e0e8
...
...
@@ -22,7 +22,6 @@ extern "C" {
#include <assert.h>
#include <ctype.h>
#include <pthread.h>
#include <semaphore.h>
#include <regex.h>
...
...
@@ -83,6 +82,7 @@ extern "C" {
#include "osMath.h"
#include "osMemory.h"
#include "osRand.h"
#include "osThread.h"
#include "osSemaphore.h"
#include "osSignal.h"
#include "osSleep.h"
...
...
@@ -90,7 +90,6 @@ extern "C" {
#include "osString.h"
#include "osSysinfo.h"
#include "osSystem.h"
#include "osThread.h"
#include "osTime.h"
#include "osTimer.h"
#include "osTimezone.h"
...
...
include/os/osSemaphore.h
浏览文件 @
caf1e0e8
...
...
@@ -20,7 +20,6 @@
extern
"C"
{
#endif
#include <pthread.h>
#include <semaphore.h>
#if defined (_TD_DARWIN_64)
...
...
@@ -38,25 +37,25 @@ extern "C" {
#endif
#if defined (_TD_DARWIN_64)
// #define
pthread_rwlock_t pthread_mutex_t
// #define
pthread_rwlock_init(lock, NULL) pthread_mutex_i
nit(lock, NULL)
// #define
pthread_rwlock_destroy(lock) pthread_mutex_d
estroy(lock)
// #define
pthread_rwlock_wrlock(lock) pthread_mutex_l
ock(lock)
// #define
pthread_rwlock_rdlock(lock) pthread_mutex_l
ock(lock)
// #define
pthread_rwlock_unlock(lock) pthread_mutex_u
nlock(lock)
// #define
TdThreadRwlock TdThreadMutex
// #define
taosThreadRwlockInit(lock, NULL) taosThreadMutexI
nit(lock, NULL)
// #define
taosThreadRwlockDestroy(lock) taosThreadMutexD
estroy(lock)
// #define
taosThreadRwlockWrlock(lock) taosThreadMutexL
ock(lock)
// #define
taosThreadRwlockRdlock(lock) taosThreadMutexL
ock(lock)
// #define
taosThreadRwlockUnlock(lock) taosThreadMutexU
nlock(lock)
#define
pthread_spinlock_t pthread_mutex_t
#define
pthread_spin_init(lock, NULL) pthread_mutex_i
nit(lock, NULL)
#define
pthread_spin_destroy(lock) pthread_mutex_d
estroy(lock)
#define
pthread_spin_lock(lock) pthread_mutex_l
ock(lock)
#define
pthread_spin_unlock(lock) pthread_mutex_u
nlock(lock)
#define
TdThreadSpinlock TdThreadMutex
#define
taosThreadSpinInit(lock, NULL) taosThreadMutexI
nit(lock, NULL)
#define
taosThreadSpinDestroy(lock) taosThreadMutexD
estroy(lock)
#define
taosThreadSpinLock(lock) taosThreadMutexL
ock(lock)
#define
taosThreadSpinUnlock(lock) taosThreadMutexU
nlock(lock)
#endif
bool
taosCheckPthreadValid
(
pthread_t
thread
);
bool
taosCheckPthreadValid
(
TdThread
thread
);
int64_t
taosGetSelfPthreadId
();
int64_t
taosGetPthreadId
(
pthread_t
thread
);
void
taosResetPthread
(
pthread_t
*
thread
);
bool
taosComparePthread
(
pthread_t
first
,
pthread_t
second
);
int64_t
taosGetPthreadId
(
TdThread
thread
);
void
taosResetPthread
(
TdThread
*
thread
);
bool
taosComparePthread
(
TdThread
first
,
TdThread
second
);
int32_t
taosGetPId
();
int32_t
taosGetAppName
(
char
*
name
,
int32_t
*
len
);
...
...
include/os/osString.h
浏览文件 @
caf1e0e8
...
...
@@ -35,7 +35,7 @@ typedef int32_t TdUcs4;
#define wctomb WCTOMB_FUNC_TAOS_FORBID
#define wcstombs WCSTOMBS_FUNC_TAOS_FORBID
#define wcsncpy WCSNCPY_FUNC_TAOS_FORBID
#define wchar_t WCHAR_T_
FUNC
_TAOS_FORBID
#define wchar_t WCHAR_T_
TYPE
_TAOS_FORBID
#endif
#if defined(_TD_WINDOWS_64) || defined(_TD_WINDOWS_32)
...
...
include/os/osThread.h
浏览文件 @
caf1e0e8
...
...
@@ -22,6 +22,94 @@
extern
"C"
{
#endif
typedef
pthread_t
TdThread
;
typedef
pthread_spinlock_t
TdThreadSpinlock
;
typedef
pthread_mutex_t
TdThreadMutex
;
typedef
pthread_mutexattr_t
TdThreadMutexAttr
;
typedef
pthread_rwlock_t
TdThreadRwlock
;
typedef
pthread_attr_t
TdThreadAttr
;
typedef
pthread_once_t
TdThreadOnce
;
typedef
pthread_rwlockattr_t
TdThreadRwlockAttr
;
typedef
pthread_cond_t
TdThreadCond
;
typedef
pthread_condattr_t
TdThreadCondAttr
;
#define taosThreadCleanupPush pthread_cleanup_push
#define taosThreadCleanupPop pthread_cleanup_pop
// If the error is in a third-party library, place this header file under the third-party library header file.
#ifndef ALLOW_FORBID_FUNC
#define pthread_t PTHREAD_T_TYPE_TAOS_FORBID
#define pthread_spinlock_t PTHREAD_SPINLOCK_T_TYPE_TAOS_FORBID
#define pthread_mutex_t PTHREAD_MUTEX_T_TYPE_TAOS_FORBID
#define pthread_mutexattr_t PTHREAD_MUTEXATTR_T_TYPE_TAOS_FORBID
#define pthread_rwlock_t PTHREAD_RWLOCK_T_TYPE_TAOS_FORBID
#define pthread_attr_t PTHREAD_ATTR_T_TYPE_TAOS_FORBID
#define pthread_once_t PTHREAD_ONCE_T_TYPE_TAOS_FORBID
#define pthread_rwlockattr_t PTHREAD_RWLOCKATTR_T_TYPE_TAOS_FORBID
#define pthread_cond_t PTHREAD_COND_T_TYPE_TAOS_FORBID
#define pthread_condattr_t PTHREAD_CONDATTR_T_TYPE_TAOS_FORBID
#define pthread_spin_init PTHREAD_SPIN_INIT_FUNC_TAOS_FORBID
#define pthread_mutex_init PTHREAD_MUTEX_INIT_FUNC_TAOS_FORBID
#define pthread_spin_destroy PTHREAD_SPIN_DESTROY_FUNC_TAOS_FORBID
#define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY_FUNC_TAOS_FORBID
#define pthread_spin_lock PTHREAD_SPIN_LOCK_FUNC_TAOS_FORBID
#define pthread_mutex_lock PTHREAD_MUTEX_LOCK_FUNC_TAOS_FORBID
#define pthread_spin_unlock PTHREAD_SPIN_UNLOCK_FUNC_TAOS_FORBID
#define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK_FUNC_TAOS_FORBID
#define pthread_rwlock_rdlock PTHREAD_RWLOCK_RDLOCK_FUNC_TAOS_FORBID
#define pthread_rwlock_wrlock PTHREAD_RWLOCK_WRLOCK_FUNC_TAOS_FORBID
#define pthread_rwlock_unlock PTHREAD_RWLOCK_UNLOCK_FUNC_TAOS_FORBID
#define pthread_testcancel PTHREAD_TESTCANCEL_FUNC_TAOS_FORBID
#define pthread_attr_init PTHREAD_ATTR_INIT_FUNC_TAOS_FORBID
#define pthread_create PTHREAD_CREATE_FUNC_TAOS_FORBID
#define pthread_once PTHREAD_ONCE_FUNC_TAOS_FORBID
#define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE_FUNC_TAOS_FORBID
#define pthread_attr_destroy PTHREAD_ATTR_DESTROY_FUNC_TAOS_FORBID
#define pthread_join PTHREAD_JOIN_FUNC_TAOS_FORBID
#define pthread_rwlock_init PTHREAD_RWLOCK_INIT_FUNC_TAOS_FORBID
#define pthread_rwlock_destroy PTHREAD_RWLOCK_DESTROY_FUNC_TAOS_FORBID
#define pthread_cond_signal PTHREAD_COND_SIGNAL_FUNC_TAOS_FORBID
#define pthread_cond_init PTHREAD_COND_INIT_FUNC_TAOS_FORBID
#define pthread_cond_broadcast PTHREAD_COND_BROADCAST_FUNC_TAOS_FORBID
#define pthread_cond_destroy PTHREAD_COND_DESTROY_FUNC_TAOS_FORBID
#define pthread_cond_wait PTHREAD_COND_WAIT_FUNC_TAOS_FORBID
#define pthread_self PTHREAD_SELF_FUNC_TAOS_FORBID
#define pthread_equal PTHREAD_EQUAL_FUNC_TAOS_FORBID
#define pthread_sigmask PTHREAD_SIGMASK_FUNC_TAOS_FORBID
#define pthread_cancel PTHREAD_CANCEL_FUNC_TAOS_FORBID
#define pthread_kill PTHREAD_KILL_FUNC_TAOS_FORBID
#endif
int32_t
taosThreadSpinInit
(
TdThreadSpinlock
*
lock
,
int
pshared
);
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
taosThreadMutexLock
(
TdThreadMutex
*
mutex
);
int32_t
taosThreadRwlockRdlock
(
TdThreadRwlock
*
rwlock
);
int32_t
taosThreadSpinUnlock
(
TdThreadSpinlock
*
lock
);
int32_t
taosThreadMutexUnlock
(
TdThreadMutex
*
mutex
);
int32_t
taosThreadRwlockWrlock
(
TdThreadRwlock
*
rwlock
);
int32_t
taosThreadRwlockUnlock
(
TdThreadRwlock
*
rwlock
);
void
taosThreadTestCancel
(
void
);
int32_t
taosThreadAttrInit
(
TdThreadAttr
*
attr
);
int32_t
taosThreadCreate
(
TdThread
*
tid
,
const
TdThreadAttr
*
attr
,
void
*
(
*
start
)(
void
*
),
void
*
arg
);
int32_t
taosThreadOnce
(
TdThreadOnce
*
onceControl
,
void
(
*
initRoutine
)(
void
));
int32_t
taosThreadAttrSetDetachState
(
TdThreadAttr
*
attr
,
int32_t
detachState
);
int32_t
taosThreadAttrDestroy
(
TdThreadAttr
*
attr
);
int32_t
taosThreadJoin
(
TdThread
thread
,
void
**
pValue
);
int32_t
taosThreadRwlockInit
(
TdThreadRwlock
*
rwlock
,
const
TdThreadRwlockAttr
*
attr
);
int32_t
taosThreadRwlockDestroy
(
TdThreadRwlock
*
rwlock
);
int32_t
taosThreadCondSignal
(
TdThreadCond
*
cond
);
int32_t
taosThreadCondInit
(
TdThreadCond
*
cond
,
const
TdThreadCondAttr
*
attr
);
int32_t
taosThreadCondBroadcast
(
TdThreadCond
*
cond
);
int32_t
taosThreadCondDestroy
(
TdThreadCond
*
cond
);
int32_t
taosThreadCondWait
(
TdThreadCond
*
cond
,
TdThreadMutex
*
mutex
);
TdThread
taosThreadSelf
(
void
);
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
);
#ifdef __cplusplus
}
#endif
...
...
include/os/osTimezone.h
浏览文件 @
caf1e0e8
...
...
@@ -20,6 +20,11 @@
extern
"C"
{
#endif
// If the error is in a third-party library, place this header file under the third-party library header file.
#ifndef ALLOW_FORBID_FUNC
#define tzset TZSET_FUNC_TAOS_FORBID
#endif
void
taosGetSystemTimezone
(
char
*
outTimezone
);
void
taosSetSystemTimezone
(
const
char
*
inTimezone
,
char
*
outTimezone
,
int8_t
*
outDaylight
);
...
...
source/libs/transport/test/uv.c
浏览文件 @
caf1e0e8
#include <assert.h>
#include <
pthread
.h>
#include <
uv
.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "task.h"
#include <uv.h>
#define NUM_OF_THREAD 1
#define TIMEOUT 10000
typedef
struct
SThreadObj
{
pthread_t
thread
;
TdThread
thread
;
uv_pipe_t
*
pipe
;
uv_loop_t
*
loop
;
uv_async_t
*
workerAsync
;
//
...
...
@@ -183,7 +182,7 @@ int main() {
server
->
pThreadObj
[
i
]
->
fd
=
fds
[
0
];
server
->
pThreadObj
[
i
]
->
pipe
=
&
(
server
->
pipe
[
i
][
1
]);
// init read
int
err
=
pthread_c
reate
(
&
(
server
->
pThreadObj
[
i
]
->
thread
),
NULL
,
int
err
=
taosThreadC
reate
(
&
(
server
->
pThreadObj
[
i
]
->
thread
),
NULL
,
worker_thread
,
(
void
*
)(
server
->
pThreadObj
[
i
]));
if
(
err
==
0
)
{
printf
(
"thread %d create
\n
"
,
i
);
...
...
source/os/src/osSemaphore.c
浏览文件 @
caf1e0e8
...
...
@@ -24,11 +24,11 @@
#include <windows.h>
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
return
thread
.
p
!=
NULL
;
}
bool
taosCheckPthreadValid
(
TdThread
thread
)
{
return
thread
.
p
!=
NULL
;
}
void
taosResetPthread
(
pthread_t
*
thread
)
{
thread
->
p
=
0
;
}
void
taosResetPthread
(
TdThread
*
thread
)
{
thread
->
p
=
0
;
}
int64_t
taosGetPthreadId
(
pthread_t
thread
)
{
int64_t
taosGetPthreadId
(
TdThread
thread
)
{
#ifdef PTW32_VERSION
return
pthread_getw32threadid_np
(
thread
);
#else
...
...
@@ -38,7 +38,7 @@ int64_t taosGetPthreadId(pthread_t thread) {
int64_t
taosGetSelfPthreadId
()
{
return
GetCurrentThreadId
();
}
bool
taosComparePthread
(
pthread_t
first
,
pthread_t
second
)
{
return
first
.
p
==
second
.
p
;
}
bool
taosComparePthread
(
TdThread
first
,
TdThread
second
)
{
return
first
.
p
==
second
.
p
;
}
int32_t
taosGetPId
()
{
return
GetCurrentProcessId
();
}
...
...
@@ -84,10 +84,9 @@ int32_t tsem_wait(tsem_t* sem) {
#include <mach/mach_init.h>
#include <mach/semaphore.h>
#include <mach/task.h>
#include <pthread.h>
static
pthread_t
sem_thread
;
static
pthread_once_t
sem_once
;
static
TdThread
sem_thread
;
static
TdThreadOnce
sem_once
;
static
task_t
sem_port
;
static
volatile
int
sem_inited
=
0
;
static
semaphore_t
sem_exit
;
...
...
@@ -110,7 +109,7 @@ static void *sem_thread_routine(void *arg) {
static
void
once_init
(
void
)
{
int
r
=
0
;
r
=
pthread_c
reate
(
&
sem_thread
,
NULL
,
sem_thread_routine
,
NULL
);
r
=
taosThreadC
reate
(
&
sem_thread
,
NULL
,
sem_thread_routine
,
NULL
);
if
(
r
)
{
fprintf
(
stderr
,
"==%s[%d]%s()==failed to create thread
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
);
return
;
...
...
@@ -123,8 +122,8 @@ static void once_init(void) {
struct
tsem_s
{
#ifdef SEM_USE_PTHREAD
pthread_mutex_t
lock
;
pthread_cond_t
cond
;
TdThreadMutex
lock
;
TdThreadCond
cond
;
volatile
int64_t
val
;
#elif defined(SEM_USE_POSIX)
size_t
id
;
...
...
@@ -151,12 +150,12 @@ int tsem_init(tsem_t *sem, int pshared, unsigned int value) {
}
#ifdef SEM_USE_PTHREAD
int
r
=
pthread_mutex_i
nit
(
&
p
->
lock
,
NULL
);
int
r
=
taosThreadMutexI
nit
(
&
p
->
lock
,
NULL
);
do
{
if
(
r
)
break
;
r
=
pthread_cond_i
nit
(
&
p
->
cond
,
NULL
);
r
=
taosThreadCondI
nit
(
&
p
->
cond
,
NULL
);
if
(
r
)
{
pthread_mutex_d
estroy
(
&
p
->
lock
);
taosThreadMutexD
estroy
(
&
p
->
lock
);
break
;
}
p
->
val
=
value
;
...
...
@@ -186,7 +185,7 @@ int tsem_init(tsem_t *sem, int pshared, unsigned int value) {
abort
();
}
while
(
p
->
sem
==
SEM_FAILED
);
#elif defined(SEM_USE_SEM)
pthread_o
nce
(
&
sem_once
,
once_init
);
taosThreadO
nce
(
&
sem_once
,
once_init
);
if
(
sem_inited
!=
1
)
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal resource init failed
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
errno
=
ENOMEM
;
...
...
@@ -224,18 +223,18 @@ int tsem_wait(tsem_t *sem) {
abort
();
}
#ifdef SEM_USE_PTHREAD
if
(
pthread_mutex_l
ock
(
&
p
->
lock
))
{
if
(
taosThreadMutexL
ock
(
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
p
->
val
-=
1
;
if
(
p
->
val
<
0
)
{
if
(
pthread_cond_w
ait
(
&
p
->
cond
,
&
p
->
lock
))
{
if
(
taosThreadCondW
ait
(
&
p
->
cond
,
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
}
if
(
pthread_mutex_u
nlock
(
&
p
->
lock
))
{
if
(
taosThreadMutexU
nlock
(
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
...
...
@@ -260,18 +259,18 @@ int tsem_post(tsem_t *sem) {
abort
();
}
#ifdef SEM_USE_PTHREAD
if
(
pthread_mutex_l
ock
(
&
p
->
lock
))
{
if
(
taosThreadMutexL
ock
(
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
p
->
val
+=
1
;
if
(
p
->
val
<=
0
)
{
if
(
pthread_cond_s
ignal
(
&
p
->
cond
))
{
if
(
taosThreadCondS
ignal
(
&
p
->
cond
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
}
if
(
pthread_mutex_u
nlock
(
&
p
->
lock
))
{
if
(
taosThreadMutexU
nlock
(
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
...
...
@@ -299,20 +298,20 @@ int tsem_destroy(tsem_t *sem) {
return
0
;
}
#ifdef SEM_USE_PTHREAD
if
(
pthread_mutex_l
ock
(
&
p
->
lock
))
{
if
(
taosThreadMutexL
ock
(
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
p
->
valid
=
0
;
if
(
pthread_cond_d
estroy
(
&
p
->
cond
))
{
if
(
taosThreadCondD
estroy
(
&
p
->
cond
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
if
(
pthread_mutex_u
nlock
(
&
p
->
lock
))
{
if
(
taosThreadMutexU
nlock
(
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
if
(
pthread_mutex_d
estroy
(
&
p
->
lock
))
{
if
(
taosThreadMutexD
estroy
(
&
p
->
lock
))
{
fprintf
(
stderr
,
"==%s[%d]%s():[%p]==internal logic error
\n
"
,
taosDirEntryBaseName
(
__FILE__
),
__LINE__
,
__func__
,
sem
);
abort
();
}
...
...
@@ -338,23 +337,23 @@ int tsem_destroy(tsem_t *sem) {
return
0
;
}
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
bool
taosCheckPthreadValid
(
TdThread
thread
)
{
uint64_t
id
=
0
;
int
r
=
pthread_t
hreadid_np
(
thread
,
&
id
);
int
r
=
TdThread
hreadid_np
(
thread
,
&
id
);
return
r
?
false
:
true
;
}
int64_t
taosGetSelfPthreadId
()
{
uint64_t
id
;
pthread_t
hreadid_np
(
0
,
&
id
);
TdThread
hreadid_np
(
0
,
&
id
);
return
(
int64_t
)
id
;
}
int64_t
taosGetPthreadId
(
pthread_t
thread
)
{
return
(
int64_t
)
thread
;
}
int64_t
taosGetPthreadId
(
TdThread
thread
)
{
return
(
int64_t
)
thread
;
}
void
taosResetPthread
(
pthread_t
*
thread
)
{
*
thread
=
NULL
;
}
void
taosResetPthread
(
TdThread
*
thread
)
{
*
thread
=
NULL
;
}
bool
taosComparePthread
(
pthread_t
first
,
pthread_t
second
)
{
return
pthread_e
qual
(
first
,
second
)
?
true
:
false
;
}
bool
taosComparePthread
(
TdThread
first
,
TdThread
second
)
{
return
taosThreadE
qual
(
first
,
second
)
?
true
:
false
;
}
int32_t
taosGetPId
()
{
return
(
int32_t
)
getpid
();
}
...
...
@@ -378,7 +377,7 @@ int32_t taosGetAppName(char *name, int32_t *len) {
#include <sys/syscall.h>
#include <unistd.h>
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
return
thread
!=
0
;
}
bool
taosCheckPthreadValid
(
TdThread
thread
)
{
return
thread
!=
0
;
}
int64_t
taosGetSelfPthreadId
()
{
static
__thread
int
id
=
0
;
...
...
@@ -387,9 +386,9 @@ int64_t taosGetSelfPthreadId() {
return
id
;
}
int64_t
taosGetPthreadId
(
pthread_t
thread
)
{
return
(
int64_t
)
thread
;
}
void
taosResetPthread
(
pthread_t
*
thread
)
{
*
thread
=
0
;
}
bool
taosComparePthread
(
pthread_t
first
,
pthread_t
second
)
{
return
first
==
second
;
}
int64_t
taosGetPthreadId
(
TdThread
thread
)
{
return
(
int64_t
)
thread
;
}
void
taosResetPthread
(
TdThread
*
thread
)
{
*
thread
=
0
;
}
bool
taosComparePthread
(
TdThread
first
,
TdThread
second
)
{
return
first
==
second
;
}
int32_t
taosGetPId
()
{
return
getpid
();
}
int32_t
taosGetAppName
(
char
*
name
,
int32_t
*
len
)
{
...
...
source/os/src/osThread.c
0 → 100644
浏览文件 @
caf1e0e8
/*
* Copyright (c) 2019 TAOS Data, Inc. <jhtao@taosdata.com>
*
* This program is free software: you can use, redistribute, and/or modify
* it under the terms of the GNU Affero General Public License, version 3
* or later ("AGPL"), as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define ALLOW_FORBID_FUNC
#include "os.h"
// int32_t taosThreadSetnameNp(TdThread thread, const char *name) {
// return pthread_setname_np(thread,name);
// }
int32_t
taosThreadSpinInit
(
TdThreadSpinlock
*
lock
,
int
pshared
)
{
return
pthread_spin_init
(
lock
,
pshared
);
}
int32_t
taosThreadMutexInit
(
TdThreadMutex
*
mutex
,
const
TdThreadMutexAttr
*
attr
)
{
return
pthread_mutex_init
(
mutex
,
attr
);
}
int32_t
taosThreadSpinDestroy
(
TdThreadSpinlock
*
lock
)
{
return
pthread_spin_destroy
(
lock
);
}
int32_t
taosThreadMutexDestroy
(
TdThreadMutex
*
mutex
)
{
return
pthread_mutex_destroy
(
mutex
);
}
int32_t
taosThreadSpinLock
(
TdThreadSpinlock
*
lock
)
{
return
pthread_spin_lock
(
lock
);
}
int32_t
taosThreadMutexLock
(
TdThreadMutex
*
mutex
)
{
return
pthread_mutex_lock
(
mutex
);
}
int32_t
taosThreadSpinUnlock
(
TdThreadSpinlock
*
lock
)
{
return
pthread_spin_unlock
(
lock
);
}
int32_t
taosThreadMutexUnlock
(
TdThreadMutex
*
mutex
)
{
return
pthread_mutex_unlock
(
mutex
);
}
int32_t
taosThreadRwlockRdlock
(
TdThreadRwlock
*
rwlock
)
{
return
pthread_rwlock_rdlock
(
rwlock
);
}
int32_t
taosThreadRwlockWrlock
(
TdThreadRwlock
*
rwlock
)
{
return
pthread_rwlock_wrlock
(
rwlock
);
}
int32_t
taosThreadRwlockUnlock
(
TdThreadRwlock
*
rwlock
)
{
return
pthread_rwlock_unlock
(
rwlock
);
}
void
taosThreadTestCancel
(
void
)
{
return
pthread_testcancel
();
}
int32_t
taosThreadAttrInit
(
TdThreadAttr
*
attr
)
{
return
pthread_attr_init
(
attr
);
}
int32_t
taosThreadCreate
(
TdThread
*
tid
,
const
TdThreadAttr
*
attr
,
void
*
(
*
start
)(
void
*
),
void
*
arg
)
{
return
pthread_create
(
tid
,
attr
,
start
,
arg
);
}
int32_t
taosThreadOnce
(
TdThreadOnce
*
onceControl
,
void
(
*
initRoutine
)(
void
))
{
return
pthread_once
(
onceControl
,
initRoutine
);
}
int32_t
taosThreadAttrSetDetachState
(
TdThreadAttr
*
attr
,
int32_t
detachState
)
{
return
pthread_attr_setdetachstate
(
attr
,
detachState
);
}
int32_t
taosThreadAttrDestroy
(
TdThreadAttr
*
attr
)
{
return
pthread_attr_destroy
(
attr
);
}
int32_t
taosThreadJoin
(
TdThread
thread
,
void
**
pValue
)
{
return
pthread_join
(
thread
,
pValue
);
}
int32_t
taosThreadRwlockInit
(
TdThreadRwlock
*
rwlock
,
const
TdThreadRwlockAttr
*
attr
)
{
return
pthread_rwlock_init
(
rwlock
,
attr
);
}
int32_t
taosThreadRwlockDestroy
(
TdThreadRwlock
*
rwlock
)
{
return
pthread_rwlock_destroy
(
rwlock
);
}
int32_t
taosThreadCondSignal
(
TdThreadCond
*
cond
)
{
return
pthread_cond_signal
(
cond
);
}
int32_t
taosThreadCondInit
(
TdThreadCond
*
cond
,
const
TdThreadCondAttr
*
attr
)
{
return
pthread_cond_init
(
cond
,
attr
);
}
int32_t
taosThreadCondBroadcast
(
TdThreadCond
*
cond
)
{
return
pthread_cond_broadcast
(
cond
);
}
int32_t
taosThreadCondDestroy
(
TdThreadCond
*
cond
)
{
return
pthread_cond_destroy
(
cond
);
}
int32_t
taosThreadCondWait
(
TdThreadCond
*
cond
,
TdThreadMutex
*
mutex
)
{
return
pthread_cond_wait
(
cond
,
mutex
);
}
TdThread
taosThreadSelf
(
void
)
{
return
pthread_self
();
}
// int32_t taosThreadGetW32ThreadIdNp(TdThread thread) {
// return pthread_getw32threadid_np(thread);
// }
int32_t
taosThreadEqual
(
TdThread
t1
,
TdThread
t2
)
{
return
pthread_equal
(
t1
,
t2
);
}
int32_t
taosThreadSigmask
(
int
how
,
sigset_t
const
*
set
,
sigset_t
*
oset
)
{
return
pthread_sigmask
(
how
,
set
,
oset
);
}
int32_t
taosThreadCancel
(
TdThread
thread
)
{
return
pthread_cancel
(
thread
);
}
int32_t
taosThreadKill
(
TdThread
thread
,
int
sig
)
{
return
pthread_kill
(
thread
,
sig
);
}
\ No newline at end of file
source/os/src/osTimezone.c
浏览文件 @
caf1e0e8
...
...
@@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#define ALLOW_FORBID_FUNC
#define _DEFAULT_SOURCE
#include "os.h"
...
...
source/util/CMakeLists.txt
浏览文件 @
caf1e0e8
...
...
@@ -5,10 +5,6 @@ target_include_directories(
util
PUBLIC
"
${
CMAKE_SOURCE_DIR
}
/include/util"
PRIVATE
"
${
CMAKE_CURRENT_SOURCE_DIR
}
/inc"
IF
(
${
TD_WINDOWS
}
)
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/contrib/pthread-win32"
PRIVATE
"
${
CMAKE_SOURCE_DIR
}
/contrib/gnuregex"
ENDIF
()
)
target_link_libraries
(
util
...
...
source/util/test/trefTest.c
浏览文件 @
caf1e0e8
#include <stdio.h>
#include <stdlib.h>
#include <pthread.h>
#include <string.h>
#include <unistd.h>
#include "os.h"
...
...
@@ -102,18 +101,18 @@ void *openRefSpace(void *param) {
pSpace
->
p
=
(
void
**
)
calloc
(
sizeof
(
void
*
),
pSpace
->
refNum
);
pSpace
->
rid
=
calloc
(
pSpace
->
refNum
,
sizeof
(
int64_t
));
pthread_attr_t
thattr
;
pthread_attr_i
nit
(
&
thattr
);
pthread_attr_setdetachs
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
TdThreadAttr
thattr
;
taosThreadAttrI
nit
(
&
thattr
);
taosThreadAttrSetDetachS
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
pthread_t
thread1
,
thread2
,
thread3
;
pthread_c
reate
(
&
(
thread1
),
&
thattr
,
addRef
,
(
void
*
)(
pSpace
));
pthread_c
reate
(
&
(
thread2
),
&
thattr
,
removeRef
,
(
void
*
)(
pSpace
));
pthread_c
reate
(
&
(
thread3
),
&
thattr
,
acquireRelease
,
(
void
*
)(
pSpace
));
TdThread
thread1
,
thread2
,
thread3
;
taosThreadC
reate
(
&
(
thread1
),
&
thattr
,
addRef
,
(
void
*
)(
pSpace
));
taosThreadC
reate
(
&
(
thread2
),
&
thattr
,
removeRef
,
(
void
*
)(
pSpace
));
taosThreadC
reate
(
&
(
thread3
),
&
thattr
,
acquireRelease
,
(
void
*
)(
pSpace
));
pthread_j
oin
(
thread1
,
NULL
);
pthread_j
oin
(
thread2
,
NULL
);
pthread_j
oin
(
thread3
,
NULL
);
taosThreadJ
oin
(
thread1
,
NULL
);
taosThreadJ
oin
(
thread2
,
NULL
);
taosThreadJ
oin
(
thread3
,
NULL
);
for
(
int
i
=
0
;
i
<
pSpace
->
refNum
;
++
i
)
{
taosRemoveRef
(
pSpace
->
rsetId
,
pSpace
->
rid
[
i
]);
...
...
@@ -161,22 +160,22 @@ int main(int argc, char *argv[]) {
taosInitLog
(
"tref.log"
,
10
);
SRefSpace
*
pSpaceList
=
(
SRefSpace
*
)
calloc
(
sizeof
(
SRefSpace
),
threads
);
pthread_t
*
pThreadList
=
(
pthread_t
*
)
calloc
(
sizeof
(
pthread_t
),
threads
);
TdThread
*
pThreadList
=
(
TdThread
*
)
calloc
(
sizeof
(
TdThread
),
threads
);
pthread_attr_t
thattr
;
pthread_attr_i
nit
(
&
thattr
);
pthread_attr_setdetachs
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
TdThreadAttr
thattr
;
taosThreadAttrI
nit
(
&
thattr
);
taosThreadAttrSetDetachS
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
for
(
int
i
=
0
;
i
<
loops
;
++
i
)
{
printf
(
"
\n
loop: %d
\n
"
,
i
);
for
(
int
j
=
0
;
j
<
threads
;
++
j
)
{
pSpaceList
[
j
].
steps
=
steps
;
pSpaceList
[
j
].
refNum
=
refNum
;
pthread_c
reate
(
&
(
pThreadList
[
j
]),
&
thattr
,
openRefSpace
,
(
void
*
)(
pSpaceList
+
j
));
taosThreadC
reate
(
&
(
pThreadList
[
j
]),
&
thattr
,
openRefSpace
,
(
void
*
)(
pSpaceList
+
j
));
}
for
(
int
j
=
0
;
j
<
threads
;
++
j
)
{
pthread_j
oin
(
pThreadList
[
j
],
NULL
);
taosThreadJ
oin
(
pThreadList
[
j
],
NULL
);
}
}
...
...
tests/script/api/batchprepare.c
浏览文件 @
caf1e0e8
// TAOS standard API example. The same syntax as MySQL, but only a subet
// to compile: gcc -o prepare prepare.c -ltaos
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -5067,11 +5066,11 @@ int main(int argc, char *argv[])
exit
(
1
);
}
pthread_t
*
pThreadList
=
(
pthread_t
*
)
calloc
(
sizeof
(
pthread_t
),
4
);
TdThread
*
pThreadList
=
(
TdThread
*
)
calloc
(
sizeof
(
TdThread
),
4
);
pthread_attr_t
thattr
;
pthread_attr_i
nit
(
&
thattr
);
pthread_attr_setdetachs
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
TdThreadAttr
thattr
;
taosThreadAttrI
nit
(
&
thattr
);
taosThreadAttrSetDetachS
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
T_par
par
[
4
];
par
[
0
].
taos
=
taos
[
0
];
...
...
@@ -5083,10 +5082,10 @@ int main(int argc, char *argv[])
par
[
3
].
taos
=
taos
[
3
];
par
[
3
].
idx
=
3
;
pthread_c
reate
(
&
(
pThreadList
[
0
]),
&
thattr
,
runcase
,
(
void
*
)
&
par
[
0
]);
//
pthread_c
reate(&(pThreadList[1]), &thattr, runcase, (void *)&par[1]);
//
pthread_c
reate(&(pThreadList[2]), &thattr, runcase, (void *)&par[2]);
//
pthread_c
reate(&(pThreadList[3]), &thattr, runcase, (void *)&par[3]);
taosThreadC
reate
(
&
(
pThreadList
[
0
]),
&
thattr
,
runcase
,
(
void
*
)
&
par
[
0
]);
//
taosThreadC
reate(&(pThreadList[1]), &thattr, runcase, (void *)&par[1]);
//
taosThreadC
reate(&(pThreadList[2]), &thattr, runcase, (void *)&par[2]);
//
taosThreadC
reate(&(pThreadList[3]), &thattr, runcase, (void *)&par[3]);
while
(
1
)
{
taosSsleep
(
1
);
...
...
tests/script/api/stmtBatchTest.c
浏览文件 @
caf1e0e8
// TAOS standard API example. The same syntax as MySQL, but only a subet
// to compile: gcc -o prepare prepare.c -ltaos
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
@@ -5080,7 +5079,7 @@ int main(int argc, char *argv[])
#if 0
printf("server:%s, threadNum:%d, rows:%d\n\n", serverIp, threadNum, g_rows);
pthread_t *pThreadList = (pthread_t *) calloc(sizeof(pthread_t
), (size_t)threadNum);
TdThread *pThreadList = (TdThread *) calloc(sizeof(TdThread
), (size_t)threadNum);
ThreadInfo* threadInfo = (ThreadInfo *) calloc(sizeof(ThreadInfo), (size_t)threadNum);
ThreadInfo* tInfo = threadInfo;
...
...
@@ -5094,16 +5093,16 @@ int main(int argc, char *argv[])
tInfo->taos = taos;
tInfo->idx = i;
if (0 == i) {
//
pthread_c
reate(&(pThreadList[0]), NULL, runCase, (void *)tInfo);
pthread_c
reate(&(pThreadList[0]), NULL, SpecifyColumnBatchCase, (void *)tInfo);
//
taosThreadC
reate(&(pThreadList[0]), NULL, runCase, (void *)tInfo);
taosThreadC
reate(&(pThreadList[0]), NULL, SpecifyColumnBatchCase, (void *)tInfo);
} else if (1 == i){
pthread_c
reate(&(pThreadList[0]), NULL, runCase_long, (void *)tInfo);
taosThreadC
reate(&(pThreadList[0]), NULL, runCase_long, (void *)tInfo);
}
tInfo++;
}
for (int i = 0; i < threadNum; i++) {
pthread_j
oin(pThreadList[i], NULL);
taosThreadJ
oin(pThreadList[i], NULL);
}
free(pThreadList);
...
...
tests/script/api/stmtTest.c
浏览文件 @
caf1e0e8
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
tests/script/api/stmt_function.c
浏览文件 @
caf1e0e8
#include <assert.h>
#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
...
...
tests/script/http/httpTest.c
浏览文件 @
caf1e0e8
...
...
@@ -5,12 +5,11 @@
#include <unistd.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <pthread.h>
#define MAXLINE 1024
typedef
struct
{
pthread_t
pid
;
TdThread
pid
;
int
threadId
;
int
rows
;
int
tables
;
...
...
@@ -107,16 +106,16 @@ void multiThread() {
ThreadObj
*
threads
=
calloc
((
size_t
)
numOfThreads
,
sizeof
(
ThreadObj
));
for
(
int
i
=
0
;
i
<
numOfThreads
;
i
++
)
{
ThreadObj
*
pthread
=
threads
+
i
;
pthread_attr_t
thattr
;
TdThreadAttr
thattr
;
pthread
->
threadId
=
i
+
1
;
pthread
->
rows
=
numOfRows
;
pthread
->
tables
=
numOfTables
;
pthread_attr_i
nit
(
&
thattr
);
pthread_attr_setdetachs
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
pthread_c
reate
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
execute
,
pthread
);
taosThreadAttrI
nit
(
&
thattr
);
taosThreadAttrSetDetachS
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
taosThreadC
reate
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
execute
,
pthread
);
}
for
(
int
i
=
0
;
i
<
numOfThreads
;
i
++
)
{
pthread_j
oin
(
threads
[
i
].
pid
,
NULL
);
taosThreadJ
oin
(
threads
[
i
].
pid
,
NULL
);
}
free
(
threads
);
}
...
...
tests/script/http/httpTestSqlUtc.c
浏览文件 @
caf1e0e8
...
...
@@ -5,12 +5,11 @@
#include <unistd.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <pthread.h>
#define MAXLINE 1024
typedef
struct
{
pthread_t
pid
;
TdThread
pid
;
int
threadId
;
int
rows
;
int
tables
;
...
...
@@ -107,16 +106,16 @@ void multiThread() {
ThreadObj
*
threads
=
calloc
((
size_t
)
numOfThreads
,
sizeof
(
ThreadObj
));
for
(
int
i
=
0
;
i
<
numOfThreads
;
i
++
)
{
ThreadObj
*
pthread
=
threads
+
i
;
pthread_attr_t
thattr
;
TdThreadAttr
thattr
;
pthread
->
threadId
=
i
+
1
;
pthread
->
rows
=
numOfRows
;
pthread
->
tables
=
numOfTables
;
pthread_attr_i
nit
(
&
thattr
);
pthread_attr_setdetachs
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
pthread_c
reate
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
execute
,
pthread
);
taosThreadAttrI
nit
(
&
thattr
);
taosThreadAttrSetDetachS
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
taosThreadC
reate
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
execute
,
pthread
);
}
for
(
int
i
=
0
;
i
<
numOfThreads
;
i
++
)
{
pthread_j
oin
(
threads
[
i
].
pid
,
NULL
);
taosThreadJ
oin
(
threads
[
i
].
pid
,
NULL
);
}
free
(
threads
);
}
...
...
tests/script/http/httpTestSqlt.c
浏览文件 @
caf1e0e8
...
...
@@ -5,12 +5,11 @@
#include <unistd.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <pthread.h>
#define MAXLINE 1024
typedef
struct
{
pthread_t
pid
;
TdThread
pid
;
int
threadId
;
int
rows
;
int
tables
;
...
...
@@ -107,16 +106,16 @@ void multiThread() {
ThreadObj
*
threads
=
calloc
((
size_t
)
numOfThreads
,
sizeof
(
ThreadObj
));
for
(
int
i
=
0
;
i
<
numOfThreads
;
i
++
)
{
ThreadObj
*
pthread
=
threads
+
i
;
pthread_attr_t
thattr
;
TdThreadAttr
thattr
;
pthread
->
threadId
=
i
+
1
;
pthread
->
rows
=
numOfRows
;
pthread
->
tables
=
numOfTables
;
pthread_attr_i
nit
(
&
thattr
);
pthread_attr_setdetachs
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
pthread_c
reate
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
execute
,
pthread
);
taosThreadAttrI
nit
(
&
thattr
);
taosThreadAttrSetDetachS
tate
(
&
thattr
,
PTHREAD_CREATE_JOINABLE
);
taosThreadC
reate
(
&
pthread
->
pid
,
&
thattr
,
(
void
*
(
*
)(
void
*
))
execute
,
pthread
);
}
for
(
int
i
=
0
;
i
<
numOfThreads
;
i
++
)
{
pthread_j
oin
(
threads
[
i
].
pid
,
NULL
);
taosThreadJ
oin
(
threads
[
i
].
pid
,
NULL
);
}
free
(
threads
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录