Initial work for adding work queues to the game engine
I wrote an implementation of work queues that crashes by design.
I'm working on improving it and documenting it.
0Now the code compiles and does what it's supposed to.
I still need to properly document everything and implement an API using epoll
and kqueue or wrap libuv because we have no way, currently, of yielding when
we haven't got data in a socket, for example.
Fixed a memory leak detected with valgrind.
Fixed another problem.
Refactored worker_thread a little and removed a possible bug.
Made necessary changes to CMake files to add a dependency on libuv.
Added a dependency on libuv.
Implemented a kind of condition variables adapted to run with
coroutines.
Made a ton of changes everywhere to integrate them.
Fixed a hidden bug in queue::swap() where we would lock a mutex twice
and never another one.
I didn't know that when a boost::context finished it calls exit().
After a very exhausting debugging process that led me to that discovery
I fixed many other problems in the code.
Refactored the code a little.
Added a few fixes to thec code that handles threads.
More simple fixes.
Finally condition_variable works and the tests are all green.
Now I have to start documenting everything.
Added a new test.