Skip to content
Snippets Groups Projects
Commit 39e8899e authored by cnowke's avatar cnowke
Browse files

removed interpreter stall when receiving a message in a python thread

parent d4955add
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <memory> #include <memory>
#include <../schema/string_message.pb.h> #include <../schema/string_message.pb.h>
#include <../schema/tick_message.pb.h>
using namespace boost::python; using namespace boost::python;
...@@ -56,7 +57,11 @@ public: ...@@ -56,7 +57,11 @@ public:
std::string receive() std::string receive()
{ {
event_type message = slot_->receive(); event_type message;
Py_BEGIN_ALLOW_THREADS
message = slot_->receive();
Py_END_ALLOW_THREADS
std::string binary_message; std::string binary_message;
if (! message.SerializeToString(&binary_message) ) if (! message.SerializeToString(&binary_message) )
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment