Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sgxwallet
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
董子豪
sgxwallet
Commits
a36f87e3
Unverified
Commit
a36f87e3
authored
Sep 07, 2021
by
kladko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SKALE-4586 Added Thread Pool
parent
9b1b6981
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
2 deletions
+17
-2
ZMQServer.cpp
zmq_src/ZMQServer.cpp
+15
-2
ZMQServer.h
zmq_src/ZMQServer.h
+2
-0
No files found.
zmq_src/ZMQServer.cpp
View file @
a36f87e3
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include "common.h"
#include "common.h"
#include "SGXException.h"
#include "SGXException.h"
#include "ExitRequestedException.h"
#include "ZMQMessage.h"
#include "ZMQMessage.h"
#include "ZMQServer.h"
#include "ZMQServer.h"
#include "sgxwallet_common.h"
#include "sgxwallet_common.h"
...
@@ -274,12 +275,24 @@ void ZMQServer::doOneServerLoop() {
...
@@ -274,12 +275,24 @@ void ZMQServer::doOneServerLoop() {
}
}
}
}
void
ZMQServer
::
workerThreadProcessNextMessage
()
{
usleep
(
1000000
);
cerr
<<
"WORKER LOOP"
<<
endl
;
}
void
ZMQServer
::
workerThreadMessageProcessLoop
(
ZMQServer
*
_agent
)
{
void
ZMQServer
::
workerThreadMessageProcessLoop
(
ZMQServer
*
_agent
)
{
CHECK_STATE
(
_agent
);
CHECK_STATE
(
_agent
);
_agent
->
waitOnGlobalStartBarrier
();
_agent
->
waitOnGlobalStartBarrier
();
// do work forever until told to exit
// do work forever until told to exit
while
(
!
isExitRequested
)
{
while
(
!
isExitRequested
)
{
usleep
(
1000000
);
try
{
cerr
<<
"WORKER LOOP"
<<
endl
;
_agent
->
workerThreadProcessNextMessage
();
}
catch
(
ExitRequestedException
&
e
)
{
break
;
}
catch
(
Exception
&
e
)
{
spdlog
::
error
(
string
(
"Caught exception in worker thread loop:"
)
+
e
.
what
());
}
}
}
spdlog
::
info
(
"Exit requested. Exiting worker thread."
);
}
}
\ No newline at end of file
zmq_src/ZMQServer.h
View file @
a36f87e3
...
@@ -79,6 +79,8 @@ public:
...
@@ -79,6 +79,8 @@ public:
static
void
workerThreadMessageProcessLoop
(
ZMQServer
*
agent
);
static
void
workerThreadMessageProcessLoop
(
ZMQServer
*
agent
);
void
workerThreadProcessNextMessage
();
};
};
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment