pthread_setname_np doesn't take a reference to the handler on mac. May need a better...
authorJustin Dickow <jjdickow@gmail.com>
Thu, 20 Mar 2014 17:44:42 +0000 (13:44 -0400)
committerJustin Dickow <jjdickow@gmail.com>
Thu, 20 Mar 2014 17:44:42 +0000 (13:44 -0400)
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
SDL_Core/src/components/Utils/src/threads/posix_thread.cc

index e59fedc..719b3d4 100644 (file)
@@ -129,7 +129,11 @@ bool Thread::startWithOptions(const ThreadOptions& options) {
   success = !pthread_create(&thread_handle_, &attributes, threadFunc,
                             delegate_);
   if (success) {
+#ifdef __linux__
     pthread_result = pthread_setname_np(thread_handle_, name_.c_str());
+#elif OS_MACOSX
+    pthread_result = pthread_setname_np(name_.c_str());
+#endif
 #   ifdef __QNXNTO__
     if (pthread_result != EOK) {
       LOG4CXX_INFO(logger_,"Couldn't set pthread name"