Skip to content
Snippets Groups Projects
Commit ec1cc9a9 authored by Aaron Cuevas Lopez's avatar Aaron Cuevas Lopez Committed by kmichaelfox
Browse files

Add some extra thread safety to the network events module

parent f45137ea
No related branches found
No related tags found
No related merge requests found
......@@ -216,8 +216,14 @@ bool NetworkEvents::closesocket()
zmq_ctx_destroy (zmqcontext); // this will cause the thread to exit
zmqcontext = nullptr;
if (!stopThread(500))
{
std::cerr << "Network thread timeout. Forcing thread termination, system could be lefr in an unstable state" << std::endl;
}
if (! shutdown)
createZmqContext();// and this will take care that processor graph doesn't attempt to delete the context again
}
#endif
return true;
......
......@@ -117,7 +117,7 @@ public:
int urlport;
String socketStatus;
bool threadRunning;
std::atomic<bool> threadRunning;
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment