c++ wrapper for libpthread