Remove the use of std::mutex
Looking through the code, you can see that the layer uses both std::mutex and pthread_mutex_t to do synchronization. This shouldn't be happening, especially since we're trying to avoid the use of exception throwing C++ objects.
We should remove the std::mutex usage, replacing it with pthreads.
Additionally, there's no explicit reference to libpthread in the CMakeLists.txt, so that should be updated as well.