diff options
author | Justin Dickow <jjdickow@gmail.com> | 2014-03-20 13:44:42 -0400 |
---|---|---|
committer | Justin Dickow <jjdickow@gmail.com> | 2014-03-20 13:44:42 -0400 |
commit | 4c75b19824d90241a0bcfcfc2d92db61a10e2072 (patch) | |
tree | 55a1308885ffa9cdd1d30957e1cf20d89e55b5ea | |
parent | 109830f7a58facd7a7197bf28c28589c1b8c693f (diff) | |
download | smartdevicelink-4c75b19824d90241a0bcfcfc2d92db61a10e2072.tar.gz |
pthread_setname_np doesn't take a reference to the handler on mac. May need a better workaround for this on Mac?
Signed-off-by: Justin Dickow <jjdickow@gmail.com>
-rw-r--r-- | SDL_Core/src/components/Utils/src/threads/posix_thread.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/SDL_Core/src/components/Utils/src/threads/posix_thread.cc b/SDL_Core/src/components/Utils/src/threads/posix_thread.cc index e59fedc2a..719b3d4a5 100644 --- a/SDL_Core/src/components/Utils/src/threads/posix_thread.cc +++ b/SDL_Core/src/components/Utils/src/threads/posix_thread.cc @@ -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" |