Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
~笨蛋陪你哭
TDengine
提交
ef8135a6
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,发现更多精彩内容 >>
提交
ef8135a6
编写于
8月 08, 2020
作者:
S
Shengliang Guan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
TD-1057
上级
ed896f97
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
3 deletion
+17
-3
src/common/src/tglobal.c
src/common/src/tglobal.c
+1
-0
src/os/inc/osSocket.h
src/os/inc/osSocket.h
+5
-1
src/os/inc/osWindows.h
src/os/inc/osWindows.h
+3
-0
src/os/src/windows/w64Env.c
src/os/src/windows/w64Env.c
+3
-0
src/plugins/http/src/httpServer.c
src/plugins/http/src/httpServer.c
+1
-0
src/rpc/src/rpcTcp.c
src/rpc/src/rpcTcp.c
+2
-1
src/sync/src/taosTcpPool.c
src/sync/src/taosTcpPool.c
+2
-1
未找到文件。
src/common/src/tglobal.c
浏览文件 @
ef8135a6
...
...
@@ -295,6 +295,7 @@ bool taosCfgDynamicOptions(char *msg) {
}
static
void
doInitGlobalConfig
(
void
)
{
osInit
();
SGlobalCfg
cfg
=
{
0
};
// ip address
...
...
src/os/inc/osSocket.h
浏览文件 @
ef8135a6
...
...
@@ -33,7 +33,11 @@ extern "C" {
} \
}
typedef
int
SOCKET
;
#endif
#endif
#ifndef TAOS_OS_DEF_EPOLL
#define TAOS_EPOLL_WAIT_TIME -1
#endif
#define taosClose(x) taosCloseSocket(x)
...
...
src/os/inc/osWindows.h
浏览文件 @
ef8135a6
...
...
@@ -94,6 +94,9 @@ extern "C" {
typedef
SOCKET
eventfd_t
;
#define eventfd(a, b) -1
#define TAOS_OS_DEF_EPOLL
#define TAOS_EPOLL_WAIT_TIME 100
#define TAOS_OS_FUNC_STRING_WCHAR
int
twcslen
(
const
wchar_t
*
wcs
);
#define TAOS_OS_FUNC_STRING_GETLINE
...
...
src/os/src/windows/w64Env.c
浏览文件 @
ef8135a6
...
...
@@ -18,6 +18,8 @@
#include "tglobal.h"
#include "tulog.h"
extern
void
taosWinSocketInit
();
void
osInit
()
{
strcpy
(
configDir
,
"C:/TDengine/cfg"
);
strcpy
(
tsVnodeDir
,
"C:/TDengine/data"
);
...
...
@@ -27,4 +29,5 @@ void osInit() {
strcpy
(
tsLogDir
,
"C:/TDengine/log"
);
strcpy
(
tsScriptDir
,
"C:/TDengine/script"
);
strcpy
(
tsOsName
,
"Windows"
);
taosWinSocketInit
();
}
\ No newline at end of file
src/plugins/http/src/httpServer.c
浏览文件 @
ef8135a6
...
...
@@ -38,6 +38,7 @@ static void httpStopThread(HttpThread* pThread) {
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
->
stop
=
true
;
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
));
...
...
src/rpc/src/rpcTcp.c
浏览文件 @
ef8135a6
...
...
@@ -174,6 +174,7 @@ static void taosStopTcpThread(SThreadObj* pThreadObj) {
if
(
fd
==
-
1
)
{
// failed to create eventfd, call pthread_cancel instead, which may result in data corruption:
tError
(
"%s, failed to create eventfd(%s)"
,
pThreadObj
->
label
,
strerror
(
errno
));
pThreadObj
->
stop
=
true
;
pthread_cancel
(
pThreadObj
->
thread
);
}
else
if
(
epoll_ctl
(
pThreadObj
->
pollFd
,
EPOLL_CTL_ADD
,
fd
,
&
event
)
<
0
)
{
// failed to call epoll_ctl, call pthread_cancel instead, which may result in data corruption:
...
...
@@ -464,7 +465,7 @@ static void *taosProcessTcpData(void *param) {
SRecvInfo
recvInfo
;
while
(
1
)
{
int
fdNum
=
epoll_wait
(
pThreadObj
->
pollFd
,
events
,
maxEvents
,
-
1
);
int
fdNum
=
epoll_wait
(
pThreadObj
->
pollFd
,
events
,
maxEvents
,
TAOS_EPOLL_WAIT_TIME
);
if
(
pThreadObj
->
stop
)
{
tDebug
(
"%s TCP thread get stop event, exiting..."
,
pThreadObj
->
label
);
break
;
...
...
src/sync/src/taosTcpPool.c
浏览文件 @
ef8135a6
...
...
@@ -184,7 +184,7 @@ static void *taosProcessTcpData(void *param) {
while
(
1
)
{
if
(
pThread
->
stop
)
break
;
int
fdNum
=
epoll_wait
(
pThread
->
pollFd
,
events
,
maxEvents
,
-
1
);
int
fdNum
=
epoll_wait
(
pThread
->
pollFd
,
events
,
maxEvents
,
TAOS_EPOLL_WAIT_TIME
);
if
(
pThread
->
stop
)
{
uDebug
(
"%p TCP epoll thread is exiting..."
,
pThread
);
break
;
...
...
@@ -313,6 +313,7 @@ static void taosStopPoolThread(SThreadObj* pThread) {
// failed to create eventfd, call pthread_cancel instead, which may result in data corruption
uError
(
"failed to create eventfd(%s)"
,
strerror
(
errno
));
pthread_cancel
(
pThread
->
thread
);
pThread
->
stop
=
true
;
}
else
if
(
epoll_ctl
(
pThread
->
pollFd
,
EPOLL_CTL_ADD
,
fd
,
&
event
)
<
0
)
{
// failed to call epoll_ctl, call pthread_cancel instead, which may result in data corruption
uError
(
"failed to call epoll_ctl(%s)"
,
strerror
(
errno
));
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录