Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
哥们要飞
TDengine
提交
2dfcac40
T
TDengine
项目概览
哥们要飞
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2dfcac40
编写于
8月 10, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1057 change pthread_t to int64
上级
d4f39548
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
13 addition
and
7 deletion
+13
-7
src/os/inc/osSemphone.h
src/os/inc/osSemphone.h
+1
-0
src/os/src/detail/osSemphone.c
src/os/src/detail/osSemphone.c
+1
-0
src/os/src/windows/w64Semphone.c
src/os/src/windows/w64Semphone.c
+4
-0
src/query/inc/qExecutor.h
src/query/inc/qExecutor.h
+1
-1
src/query/src/qExecutor.c
src/query/src/qExecutor.c
+6
-6
未找到文件。
src/os/inc/osSemphone.h
浏览文件 @
2dfcac40
...
@@ -32,6 +32,7 @@ extern "C" {
...
@@ -32,6 +32,7 @@ extern "C" {
bool
taosCheckPthreadValid
(
pthread_t
thread
);
bool
taosCheckPthreadValid
(
pthread_t
thread
);
int64_t
taosGetPthreadId
();
int64_t
taosGetPthreadId
();
void
taosResetPthread
(
pthread_t
*
thread
);
void
taosResetPthread
(
pthread_t
*
thread
);
bool
taosComparePthread
(
pthread_t
first
,
pthread_t
second
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
...
...
src/os/src/detail/osSemphone.c
浏览文件 @
2dfcac40
...
@@ -21,5 +21,6 @@
...
@@ -21,5 +21,6 @@
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
return
thread
!=
0
;
}
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
return
thread
!=
0
;
}
int64_t
taosGetPthreadId
()
{
return
(
int64_t
)
pthread_self
();
}
int64_t
taosGetPthreadId
()
{
return
(
int64_t
)
pthread_self
();
}
void
taosResetPthread
(
pthread_t
*
thread
)
{
*
thread
=
0
;
}
void
taosResetPthread
(
pthread_t
*
thread
)
{
*
thread
=
0
;
}
bool
taosComparePthread
(
pthread_t
first
,
pthread_t
second
)
{
return
first
==
second
;
}
#endif
#endif
\ No newline at end of file
src/os/src/windows/w64Semphone.c
浏览文件 @
2dfcac40
...
@@ -32,3 +32,7 @@ int64_t taosGetPthreadId() {
...
@@ -32,3 +32,7 @@ int64_t taosGetPthreadId() {
return
(
int64_t
)
pthread_self
();
return
(
int64_t
)
pthread_self
();
#endif
#endif
}
}
bool
taosComparePthread
(
pthread_t
first
,
pthread_t
second
)
{
return
first
.
p
==
second
.
p
;
}
src/query/inc/qExecutor.h
浏览文件 @
2dfcac40
...
@@ -186,7 +186,7 @@ enum {
...
@@ -186,7 +186,7 @@ enum {
typedef
struct
SQInfo
{
typedef
struct
SQInfo
{
void
*
signature
;
void
*
signature
;
int32_t
code
;
// error code to returned to client
int32_t
code
;
// error code to returned to client
pthread_t
owner
;
// if it is in execution
int64_t
owner
;
// if it is in execution
void
*
tsdb
;
void
*
tsdb
;
int32_t
vgId
;
int32_t
vgId
;
STableGroupInfo
tableGroupInfo
;
// table id list < only includes the STable list>
STableGroupInfo
tableGroupInfo
;
// table id list < only includes the STable list>
...
...
src/query/src/qExecutor.c
浏览文件 @
2dfcac40
...
@@ -130,8 +130,8 @@ static void finalizeQueryResult(SQueryRuntimeEnv *pRuntimeEnv);
...
@@ -130,8 +130,8 @@ static void finalizeQueryResult(SQueryRuntimeEnv *pRuntimeEnv);
(tw)->ekey = (tw)->skey + ((_q)->intervalTime - 1); \
(tw)->ekey = (tw)->skey + ((_q)->intervalTime - 1); \
} while (0)
} while (0)
#define SET_STABLE_QUERY_OVER(_q) ((_q)->tableIndex = (
_q)->tableqinfoGroupInfo.numOfTables
)
#define SET_STABLE_QUERY_OVER(_q) ((_q)->tableIndex = (
int32_t)((_q)->tableqinfoGroupInfo.numOfTables)
)
#define IS_STASBLE_QUERY_OVER(_q) ((_q)->tableIndex >= (
_q)->tableqinfoGroupInfo.numOfTables
)
#define IS_STASBLE_QUERY_OVER(_q) ((_q)->tableIndex >= (
int32_t)((_q)->tableqinfoGroupInfo.numOfTables)
)
// todo move to utility
// todo move to utility
static
int32_t
mergeIntoGroupResultImpl
(
SQInfo
*
pQInfo
,
SArray
*
group
);
static
int32_t
mergeIntoGroupResultImpl
(
SQInfo
*
pQInfo
,
SArray
*
group
);
...
@@ -6378,8 +6378,8 @@ static bool doBuildResCheck(SQInfo* pQInfo) {
...
@@ -6378,8 +6378,8 @@ static bool doBuildResCheck(SQInfo* pQInfo) {
pthread_mutex_unlock
(
&
pQInfo
->
lock
);
pthread_mutex_unlock
(
&
pQInfo
->
lock
);
// clear qhandle owner
// clear qhandle owner
assert
(
pQInfo
->
owner
==
pthread_self
());
assert
(
pQInfo
->
owner
==
taosGetPthreadId
());
taosResetPthread
(
&
pQInfo
->
owner
)
;
pQInfo
->
owner
=
0
;
return
buildRes
;
return
buildRes
;
}
}
...
@@ -6387,7 +6387,7 @@ static bool doBuildResCheck(SQInfo* pQInfo) {
...
@@ -6387,7 +6387,7 @@ static bool doBuildResCheck(SQInfo* pQInfo) {
bool
qTableQuery
(
qinfo_t
qinfo
)
{
bool
qTableQuery
(
qinfo_t
qinfo
)
{
SQInfo
*
pQInfo
=
(
SQInfo
*
)
qinfo
;
SQInfo
*
pQInfo
=
(
SQInfo
*
)
qinfo
;
assert
(
pQInfo
&&
pQInfo
->
signature
==
pQInfo
);
assert
(
pQInfo
&&
pQInfo
->
signature
==
pQInfo
);
int64_t
threadId
=
pthread_self
();
int64_t
threadId
=
taosGetPthreadId
();
int64_t
curOwner
=
0
;
int64_t
curOwner
=
0
;
if
((
curOwner
=
atomic_val_compare_exchange_64
(
&
pQInfo
->
owner
,
0
,
threadId
))
!=
0
)
{
if
((
curOwner
=
atomic_val_compare_exchange_64
(
&
pQInfo
->
owner
,
0
,
threadId
))
!=
0
)
{
...
@@ -6549,7 +6549,7 @@ int32_t qKillQuery(qinfo_t qinfo) {
...
@@ -6549,7 +6549,7 @@ int32_t qKillQuery(qinfo_t qinfo) {
// Wait for the query executing thread being stopped/
// Wait for the query executing thread being stopped/
// Once the query is stopped, the owner of qHandle will be cleared immediately.
// Once the query is stopped, the owner of qHandle will be cleared immediately.
while
(
taosCheckPthreadValid
(
pQInfo
->
owner
)
)
{
while
(
pQInfo
->
owner
!=
0
)
{
taosMsleep
(
100
);
taosMsleep
(
100
);
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录