]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/unix/thread.cpp
Add an interface for naming threads
[libs/core.git] / source / core / unix / thread.cpp
index e7d7f58596e94d3eba13cfc5db65ed28032c7530..3c17a9aabc8054c423253c115ba803325dc3de62 100644 (file)
@@ -3,8 +3,6 @@
 #include "thread.h"
 #include "thread_private.h"
 
-using namespace std;
-
 namespace Msp {
 
 void Thread::platform_join()
@@ -22,4 +20,10 @@ void Thread::platform_launch()
        pthread_create(&priv_->handle, 0, &Private::main_wrapper, this);
 }
 
+void Thread::platform_setname()
+{
+       if(!name_.empty())
+               pthread_setname_np(priv_->handle, name_.c_str());
+}
+
 } // namespace Msp