robotconscience / ofxLibwebsockets

[Deprecated] openFrameworks wrapper of libwebsockets for WebSocket client and server functionality
Other
171 stars 68 forks source link

Race condition #93

Open chuckleplant opened 7 years ago

chuckleplant commented 7 years ago

Great lib!

Found this:

The deque elements in Connection are accessed both by the Server thread and the one that enqueues via Server::send. This is a race condition as std::deque is not thread safe.

Hotfix: Use a mutex in Server both in the Connection::update and the Connection::send calls.

Betterfix: Use this lock free FIFO structure