C++ wrapper for posix threads