]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/unix/thread.cpp
Use nullptr instead of 0 for pointers
[libs/core.git] / source / core / unix / thread.cpp
index e7d7f58596e94d3eba13cfc5db65ed28032c7530..42231934c00ed6c58b9e0ec766bee7cecf7f3ebf 100644 (file)
@@ -3,23 +3,29 @@
 #include "thread.h"
 #include "thread_private.h"
 
-using namespace std;
-
 namespace Msp {
 
 void Thread::platform_join()
 {
-       pthread_join(priv_->handle, 0);
+       pthread_join(_priv->handle, nullptr);
 }
 
 void Thread::platform_kill()
 {
-       pthread_kill(priv_->handle, SIGKILL);
+       pthread_kill(_priv->handle, SIGKILL);
 }
 
 void Thread::platform_launch()
 {
-       pthread_create(&priv_->handle, 0, &Private::main_wrapper, this);
+       pthread_create(&_priv->handle, nullptr, &Private::main_wrapper, this);
+}
+
+void Thread::platform_setname()
+{
+#if defined(__GLIBC__) && (__GLIBC__>2 || (__GLIBC__==2 && __GLIBC_MINOR__>=12))
+       if(!_name.empty())
+               pthread_setname_np(_priv->handle, _name.c_str());
+#endif
 }
 
 } // namespace Msp