Commit 57715c18 authored by samaingw's avatar samaingw

Acthon: Lock message queue before pushing to it

parent 79277a2d
...@@ -1193,7 +1193,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -1193,7 +1193,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("/* Push message in the queue */") code.putln("/* Push message in the queue */")
code.putln("if (this->%s != NULL) {" % queue_attr_cname) code.putln("if (this->%s != NULL) {" % queue_attr_cname)
code.putln("Cy_WLOCK(%s);" % queue_attr_cname)
code.putln("this->%s->push(message);" % queue_attr_cname) code.putln("this->%s->push(message);" % queue_attr_cname)
code.putln("Cy_UNLOCK(%s);" % queue_attr_cname)
code.putln("} else {") code.putln("} else {")
code.putln("/* We should definitely shout here */") code.putln("/* We should definitely shout here */")
code.putln('fprintf(stderr, "Acthon error: No queue to push to for %s remote call !\\n");' % reified_function_entry.name) code.putln('fprintf(stderr, "Acthon error: No queue to push to for %s remote call !\\n");' % reified_function_entry.name)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment