Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
学嗨无涯
zoompipeline
提交
9f71f238
zoompipeline
项目概览
学嗨无涯
/
zoompipeline
与 Fork 源项目一致
Fork自
colorEagleStdio / zoompipeline
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
zoompipeline
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
9f71f238
编写于
6月 03, 2014
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Sloved a serious problem in 7*24 heavy test
上级
61cf5f90
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
66 addition
and
23 deletion
+66
-23
ZoomPipeline_FuncSvr/cluster/zp_clusternode.cpp
ZoomPipeline_FuncSvr/cluster/zp_clusternode.cpp
+38
-15
ZoomPipeline_FuncSvr/pipeline/zp_pltaskbase.cpp
ZoomPipeline_FuncSvr/pipeline/zp_pltaskbase.cpp
+10
-0
ZoomPipeline_FuncSvr/pipeline/zp_pltaskbase.h
ZoomPipeline_FuncSvr/pipeline/zp_pltaskbase.h
+4
-0
ZoomPipeline_FuncSvr/pipeline/zp_plworkingthread.cpp
ZoomPipeline_FuncSvr/pipeline/zp_plworkingthread.cpp
+14
-4
ZoomPipeline_FuncSvr/smartlink/st_clientnode_basetrans.cpp
ZoomPipeline_FuncSvr/smartlink/st_clientnode_basetrans.cpp
+0
-4
未找到文件。
ZoomPipeline_FuncSvr/cluster/zp_clusternode.cpp
浏览文件 @
9f71f238
...
...
@@ -57,10 +57,6 @@ namespace ZP_Cluster{
//qDebug()<<QString("%1(%2) Node Martked Deleted, return.\n").arg((unsigned int)this).arg(ref());
return
0
;
}
//This is important! sometimes without this check, m_list_RawData will crash.
//For a single zp_ClusterNode instance, at anytime, there should be only ONE thread in which run() is running.
if
(
ref
()
>
1
)
return
-
1
;
int
nCurrSz
=
-
1
;
int
nMessage
=
m_nMessageBlockSize
;
while
(
--
nMessage
>=
0
&&
nCurrSz
!=
0
)
...
...
@@ -144,10 +140,18 @@ namespace ZP_Cluster{
if
(
m_currentHeader
.
Mark
==
0x1234
)
//Valid Message
{
while
(
m_currentMessageSize
<
sizeof
(
CROSS_SVR_MSG
::
tag_header
)
&&
blocklen
>
offset
)
//while (m_currentMessageSize< sizeof(CROSS_SVR_MSG::tag_header) && blocklen>offset)
if
(
m_currentMessageSize
<
sizeof
(
CROSS_SVR_MSG
::
tag_header
)
&&
blocklen
>
offset
)
{
m_currentBlock
.
push_back
(
dataptr
[
offset
++
]);
m_currentMessageSize
++
;
int
nCpy
=
sizeof
(
CROSS_SVR_MSG
::
tag_header
)
-
m_currentMessageSize
;
if
(
nCpy
>
blocklen
-
offset
)
nCpy
=
blocklen
-
offset
;
QByteArray
arrCpy
(
dataptr
+
offset
,
nCpy
);
m_currentBlock
.
push_back
(
arrCpy
);
//m_currentBlock.push_back(dataptr[offset++]);
//m_currentMessageSize++;
offset
+=
nCpy
;
m_currentMessageSize
+=
nCpy
;
}
if
(
m_currentMessageSize
<
sizeof
(
CROSS_SVR_MSG
::
tag_header
))
//Header not completed.
continue
;
...
...
@@ -161,11 +165,20 @@ namespace ZP_Cluster{
{
qint32
bitLeft
=
m_currentHeader
.
data_length
+
sizeof
(
CROSS_SVR_MSG
::
tag_header
)
-
m_currentMessageSize
;
while
(
bitLeft
>
0
&&
blocklen
>
offset
)
//while (bitLeft>0 && blocklen>offset)
if
(
bitLeft
>
0
&&
blocklen
>
offset
)
{
m_currentBlock
.
push_back
(
dataptr
[
offset
++
]);
m_currentMessageSize
++
;
bitLeft
--
;
int
nCpy
=
bitLeft
;
if
(
nCpy
>
blocklen
-
offset
)
nCpy
=
blocklen
-
offset
;
QByteArray
arrCpy
(
dataptr
+
offset
,
nCpy
);
m_currentBlock
.
push_back
(
arrCpy
);
offset
+=
nCpy
;
m_currentMessageSize
+=
nCpy
;
bitLeft
-=
nCpy
;
//m_currentBlock.push_back(dataptr[offset++]);
//m_currentMessageSize++;
//bitLeft--;
}
//deal block, may be send data as soon as possible;
deal_current_message_block
();
...
...
@@ -183,11 +196,21 @@ namespace ZP_Cluster{
{
qint32
bitLeft
=
m_currentHeader
.
data_length
+
sizeof
(
CROSS_SVR_MSG
::
tag_header
)
-
m_currentMessageSize
;
while
(
bitLeft
>
0
&&
blocklen
>
offset
)
//while (bitLeft>0 && blocklen>offset)
if
(
bitLeft
>
0
&&
blocklen
>
offset
)
{
m_currentBlock
.
push_back
(
dataptr
[
offset
++
]);
m_currentMessageSize
++
;
bitLeft
--
;
int
nCpy
=
bitLeft
;
if
(
nCpy
>
blocklen
-
offset
)
nCpy
=
blocklen
-
offset
;
QByteArray
arrCpy
(
dataptr
+
offset
,
nCpy
);
m_currentBlock
.
push_back
(
arrCpy
);
offset
+=
nCpy
;
m_currentMessageSize
+=
nCpy
;
bitLeft
-=
nCpy
;
//m_currentBlock.push_back(dataptr[offset++]);
//m_currentMessageSize++;
//bitLeft--;
}
//deal block, may be processed as soon as possible;
deal_current_message_block
();
...
...
ZoomPipeline_FuncSvr/pipeline/zp_pltaskbase.cpp
浏览文件 @
9f71f238
...
...
@@ -25,4 +25,14 @@ namespace ZPTaskEngine{
QMutexLocker
locker
(
&
m_mutex_ref
);
return
refCount
;
}
bool
zp_plTaskBase
::
LockRun
()
{
return
m_mutex_run
.
tryLock
();
}
void
zp_plTaskBase
::
UnlockRun
()
{
return
m_mutex_run
.
unlock
();
}
}
ZoomPipeline_FuncSvr/pipeline/zp_pltaskbase.h
浏览文件 @
9f71f238
...
...
@@ -27,9 +27,13 @@ namespace ZPTaskEngine{
int
ref
();
bool
LockRun
();
void
UnlockRun
();
private:
int
refCount
;
QMutex
m_mutex_ref
;
QMutex
m_mutex_run
;
signals:
public
slots
:
...
...
ZoomPipeline_FuncSvr/pipeline/zp_plworkingthread.cpp
浏览文件 @
9f71f238
...
...
@@ -54,11 +54,21 @@ namespace ZPTaskEngine{
if
(
bValid
==
true
&&
ptr
!=
NULL
)
{
m_bBusy
=
true
;
int
res
=
ptr
->
run
();
ptr
->
delRef
();
m_bBusy
=
false
;
if
(
res
!=
0
)
if
(
ptr
->
LockRun
()
==
true
)
{
int
res
=
ptr
->
run
();
ptr
->
delRef
();
if
(
res
!=
0
)
this
->
m_pipeline
->
pushTask
(
ptr
,
false
);
ptr
->
UnlockRun
();
}
else
{
ptr
->
delRef
();
this
->
m_pipeline
->
pushTask
(
ptr
,
false
);
}
m_bBusy
=
false
;
}
emit
taskFinished
(
this
);
...
...
ZoomPipeline_FuncSvr/smartlink/st_clientnode_basetrans.cpp
浏览文件 @
9f71f238
...
...
@@ -49,10 +49,6 @@ namespace ExampleServer{
//qDebug()<<QString("%1(%2) Node Martked Deleted, return.\n").arg((unsigned int)this).arg(ref());
return
0
;
}
//This is important! sometimes without this check, m_list_RawData will crash.
//For a single zp_ClusterNode instance, at anytime, there should be only ONE thread in which run() is running.
if
(
ref
()
>
1
)
return
-
1
;
int
nCurrSz
=
-
1
;
int
nMessage
=
m_nMessageBlockSize
;
while
(
--
nMessage
>=
0
&&
nCurrSz
!=
0
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录