X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fcore%2Funix%2Fthread.cpp;h=119d55f0571600a4b57de1bd1fea054acc1fb9d2;hb=c3e242c2629cbc9645258b30aaf07b7285d4372b;hp=e7d7f58596e94d3eba13cfc5db65ed28032c7530;hpb=609c9a508cfdc7b42c46c4f21d17639204165a00;p=libs%2Fcore.git diff --git a/source/core/unix/thread.cpp b/source/core/unix/thread.cpp index e7d7f58..119d55f 100644 --- a/source/core/unix/thread.cpp +++ b/source/core/unix/thread.cpp @@ -3,8 +3,6 @@ #include "thread.h" #include "thread_private.h" -using namespace std; - namespace Msp { void Thread::platform_join() @@ -22,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