X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=blobdiff_plain;f=source%2Fcore%2Funix%2Fthread.cpp;h=1ddcaaea4bcf947a50fb411f0991a86b8b47def9;hp=e7d7f58596e94d3eba13cfc5db65ed28032c7530;hb=5763dd6e8089c97699cbcbd221afb7fe1841bcdd;hpb=609c9a508cfdc7b42c46c4f21d17639204165a00 diff --git a/source/core/unix/thread.cpp b/source/core/unix/thread.cpp index e7d7f58..1ddcaae 100644 --- a/source/core/unix/thread.cpp +++ b/source/core/unix/thread.cpp @@ -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, 0); } 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, 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