Added header comment
Removed issues. The real problem here seemed to be a mutex-unlock without a corresponding lock, which results in undefined behavior according to the docs. Everything seems fine if the lock/unlock are not there or if they both are.