cocaine/cocaine-core — pull request #136 by 3Hren (2014-10-13 09:45:34+00:00)
Title: [Bug Fix] Fixed race condition in slave session.

Message queue is thread-unsafe by design: uncontrolled access to it from multiple threads results in undefined behavior. All chunks are guaranteed to be pushed from engine's thread, but `invoke` event is sent from session creator thread which differs from the previous one. Sometimes `chunk` event was followed by `invoke` event, which is bug.

Now message queue is synchronized explicitly.