Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
268baa3d
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
未验证
提交
268baa3d
编写于
5月 22, 2020
作者:
S
Shengliang Guan
提交者:
GitHub
5月 22, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #1999 from taosdata/patch/exiting
td-337: add error log when have to call pthread_cancel
上级
c0a5eeeb
2fc85a22
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
4 deletion
+10
-4
src/os/linux/src/linuxPlatform.c
src/os/linux/src/linuxPlatform.c
+6
-4
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+2
-0
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+2
-0
未找到文件。
src/os/linux/src/linuxPlatform.c
浏览文件 @
268baa3d
...
...
@@ -148,6 +148,10 @@ static void taosDeleteTimer(void *tharg) {
timer_delete
(
*
pTimer
);
}
static
pthread_t
timerThread
;
static
timer_t
timerId
;
static
volatile
bool
stopTimer
=
false
;
void
*
taosProcessAlarmSignal
(
void
*
tharg
)
{
// Block the signal
sigset_t
sigset
;
...
...
@@ -156,7 +160,6 @@ void *taosProcessAlarmSignal(void *tharg) {
sigprocmask
(
SIG_BLOCK
,
&
sigset
,
NULL
);
void
(
*
callback
)(
int
)
=
tharg
;
static
timer_t
timerId
;
struct
sigevent
sevent
=
{{
0
}};
#ifdef _ALPINE
...
...
@@ -187,7 +190,7 @@ void *taosProcessAlarmSignal(void *tharg) {
}
int
signo
;
while
(
1
)
{
while
(
!
stopTimer
)
{
if
(
sigwait
(
&
sigset
,
&
signo
))
{
uError
(
"Failed to wait signal: number %d"
,
signo
);
continue
;
...
...
@@ -202,7 +205,6 @@ void *taosProcessAlarmSignal(void *tharg) {
return
NULL
;
}
static
pthread_t
timerThread
;
int
taosInitTimer
(
void
(
*
callback
)(
int
),
int
ms
)
{
pthread_attr_t
tattr
;
...
...
@@ -217,7 +219,7 @@ int taosInitTimer(void (*callback)(int), int ms) {
}
void
taosUninitTimer
()
{
pthread_cancel
(
timerThread
)
;
stopTimer
=
true
;
pthread_join
(
timerThread
,
NULL
);
}
...
...
src/plugins/http/src/httpServer.c
浏览文件 @
268baa3d
...
...
@@ -267,8 +267,10 @@ static void httpStopThread(HttpThread* pThread) {
struct
epoll_event
event
=
{
.
events
=
EPOLLIN
};
eventfd_t
fd
=
eventfd
(
1
,
0
);
if
(
fd
==
-
1
)
{
httpError
(
"%s, failed to create eventfd, will call pthread_cancel instead, which may result in data corruption: %s"
,
pThread
->
label
,
strerror
(
errno
));
pthread_cancel
(
pThread
->
thread
);
}
else
if
(
epoll_ctl
(
pThread
->
pollFd
,
EPOLL_CTL_ADD
,
fd
,
&
event
)
<
0
)
{
httpError
(
"%s, failed to call epoll_ctl, will call pthread_cancel instead, which may result in data corruption: %s"
,
pThread
->
label
,
strerror
(
errno
));
pthread_cancel
(
pThread
->
thread
);
}
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
268baa3d
...
...
@@ -147,8 +147,10 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) {
struct
epoll_event
event
=
{
.
events
=
EPOLLIN
};
eventfd_t
fd
=
eventfd
(
1
,
0
);
if
(
fd
==
-
1
)
{
tError
(
"%s, failed to create eventfd, will call pthread_cancel instead, which may result in data corruption: %s"
,
pThreadObj
->
label
,
strerror
(
errno
));
pthread_cancel
(
pThreadObj
->
thread
);
}
else
if
(
epoll_ctl
(
pThreadObj
->
pollFd
,
EPOLL_CTL_ADD
,
fd
,
&
event
)
<
0
)
{
tError
(
"%s, failed to call epoll_ctl, will call pthread_cancel instead, which may result in data corruption: %s"
,
pThreadObj
->
label
,
strerror
(
errno
));
pthread_cancel
(
pThreadObj
->
thread
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录