From df9866fedbbd61b26f966f60927be756b29d7b06 Mon Sep 17 00:00:00 2001 From: "pwestin@webrtc.org" Date: Wed, 11 Jan 2012 08:57:47 +0000 Subject: [PATCH] Bugfix mac pid_t Review URL: http://webrtc-codereview.appspot.com/350004 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1384 4adac7df-926f-26a2-2b94-8c16560cd09d --- src/system_wrappers/source/thread_posix.cc | 8 ++++++-- src/system_wrappers/source/thread_posix.h | 2 ++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/system_wrappers/source/thread_posix.cc b/src/system_wrappers/source/thread_posix.cc index 333c3e791..402375781 100644 --- a/src/system_wrappers/source/thread_posix.cc +++ b/src/system_wrappers/source/thread_posix.cc @@ -64,9 +64,11 @@ ThreadPosix::ThreadPosix(ThreadRunFunction func, ThreadObj obj, _dead(true), _prio(prio), _event(EventWrapper::Create()), - _setThreadName(false), - _pid(-1) + _setThreadName(false) { +#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)) + _pid = -1; +#endif if (threadName != NULL) { _setThreadName = true; @@ -279,7 +281,9 @@ void ThreadPosix::Run() { _alive = true; _dead = false; +#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)) _pid = GetThreadId(); +#endif // The event the Start() is waiting for. _event->Set(); diff --git a/src/system_wrappers/source/thread_posix.h b/src/system_wrappers/source/thread_posix.h index 85613de47..b2d13d5dc 100644 --- a/src/system_wrappers/source/thread_posix.h +++ b/src/system_wrappers/source/thread_posix.h @@ -59,7 +59,9 @@ private: // handle to thread pthread_attr_t _attr; pthread_t _thread; +#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID)) pid_t _pid; +#endif }; } // namespace webrtc