Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
94638ed2
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
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看板
提交
94638ed2
编写于
5月 22, 2020
作者:
B
Bomin Zhang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add error log when have to call pthread_cancel
上级
674332a5
变更
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
浏览文件 @
94638ed2
...
...
@@ -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
浏览文件 @
94638ed2
...
...
@@ -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
浏览文件 @
94638ed2
...
...
@@ -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.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录