Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
buyaopa
TDengine
提交
829caf39
T
TDengine
项目概览
buyaopa
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
3
Star
0
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,发现更多精彩内容 >>
提交
829caf39
编写于
8月 27, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
td-1242: wait again if sem_wait returns EINTR
上级
a393cc75
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
18 addition
and
20 deletion
+18
-20
src/dnode/src/dnodeSystem.c
src/dnode/src/dnodeSystem.c
+2
-5
src/os/inc/osSemphone.h
src/os/inc/osSemphone.h
+1
-1
src/os/src/detail/osSemphone.c
src/os/src/detail/osSemphone.c
+12
-0
src/sync/src/tarbitrator.c
src/sync/src/tarbitrator.c
+1
-3
src/util/src/tsched.c
src/util/src/tsched.c
+2
-11
未找到文件。
src/dnode/src/dnodeSystem.c
浏览文件 @
829caf39
...
...
@@ -119,11 +119,8 @@ int32_t main(int32_t argc, char *argv[]) {
syslog
(
LOG_INFO
,
"Started TDengine service successfully."
);
for
(
int
res
=
tsem_wait
(
&
exitSem
);
res
!=
0
;
res
=
tsem_wait
(
&
exitSem
))
{
if
(
errno
!=
EINTR
)
{
syslog
(
LOG_ERR
,
"failed to wait exit semphore: %s"
,
strerror
(
errno
));
break
;
}
if
(
tsem_wait
(
&
exitSem
)
!=
0
)
{
syslog
(
LOG_ERR
,
"failed to wait exit semphore: %s"
,
strerror
(
errno
));
}
dnodeCleanUpSystem
();
...
...
src/os/inc/osSemphone.h
浏览文件 @
829caf39
...
...
@@ -23,7 +23,7 @@ extern "C" {
#ifndef TAOS_OS_FUNC_SEMPHONE
#define tsem_t sem_t
#define tsem_init sem_init
#define tsem_wait sem_wait
int
tsem_wait
(
tsem_t
*
sem
);
#define tsem_post sem_post
#define tsem_destroy sem_destroy
#endif
...
...
src/os/src/detail/osSemphone.c
浏览文件 @
829caf39
...
...
@@ -16,6 +16,18 @@
#define _DEFAULT_SOURCE
#include "os.h"
#ifndef TAOS_OS_FUNC_SEMPHONE
int
tsem_wait
(
tsem_t
*
sem
)
{
int
ret
=
0
;
do
{
ret
=
sem_wait
(
sem
);
}
while
(
ret
!=
0
&&
errno
==
EINTR
);
return
ret
;
}
#endif
#ifndef TAOS_OS_FUNC_SEMPHONE_PTHREAD
bool
taosCheckPthreadValid
(
pthread_t
thread
)
{
return
thread
!=
0
;
}
...
...
src/sync/src/tarbitrator.c
浏览文件 @
829caf39
...
...
@@ -103,9 +103,7 @@ int main(int argc, char *argv[]) {
sInfo
(
"TAOS arbitrator: %s:%d is running"
,
tsNodeFqdn
,
tsArbitratorPort
);
for
(
int
res
=
tsem_wait
(
&
tsArbSem
);
res
!=
0
;
res
=
tsem_wait
(
&
tsArbSem
))
{
if
(
errno
!=
EINTR
)
break
;
}
tsem_wait
(
&
tsArbSem
);
taosCloseTcpThreadPool
(
tsArbTcpPool
);
sInfo
(
"TAOS arbitrator is shut down
\n
"
);
...
...
src/util/src/tsched.c
浏览文件 @
829caf39
...
...
@@ -123,11 +123,6 @@ void *taosProcessSchedQueue(void *param) {
while
(
1
)
{
if
(
tsem_wait
(
&
pSched
->
fullSem
)
!=
0
)
{
if
(
errno
==
EINTR
)
{
/* sem_wait is interrupted by interrupt, ignore and continue */
uDebug
(
"wait %s fullSem was interrupted"
,
pSched
->
label
);
continue
;
}
uError
(
"wait %s fullSem failed(%s)"
,
pSched
->
label
,
strerror
(
errno
));
}
if
(
pSched
->
stop
)
{
...
...
@@ -163,12 +158,8 @@ int taosScheduleTask(void *qhandle, SSchedMsg *pMsg) {
return
0
;
}
while
(
tsem_wait
(
&
pSched
->
emptySem
)
!=
0
)
{
if
(
errno
!=
EINTR
)
{
uError
(
"wait %s emptySem failed(%s)"
,
pSched
->
label
,
strerror
(
errno
));
break
;
}
uDebug
(
"wait %s emptySem was interrupted"
,
pSched
->
label
);
if
(
tsem_wait
(
&
pSched
->
emptySem
)
!=
0
)
{
uError
(
"wait %s emptySem failed(%s)"
,
pSched
->
label
,
strerror
(
errno
));
}
if
(
pthread_mutex_lock
(
&
pSched
->
queueMutex
)
!=
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录