Posix thread wrapper for C++