]> git.tdb.fi Git - libs/core.git/blobdiff - source/core/unix/thread.cpp
Pthread_setname_np is a GNU extension
[libs/core.git] / source / core / unix / thread.cpp
index 26afeefc4300e0955b52ca72931c1c2b63eb0d16..119d55f0571600a4b57de1bd1fea054acc1fb9d2 100644 (file)
@@ -20,4 +20,12 @@ void Thread::platform_launch()
        pthread_create(&priv_->handle, 0, &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