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
This commit is contained in:
pwestin@webrtc.org 2012-01-11 08:57:47 +00:00
parent b54d72778c
commit df9866fedb
2 changed files with 8 additions and 2 deletions

View File

@ -64,9 +64,11 @@ ThreadPosix::ThreadPosix(ThreadRunFunction func, ThreadObj obj,
_dead(true), _dead(true),
_prio(prio), _prio(prio),
_event(EventWrapper::Create()), _event(EventWrapper::Create()),
_setThreadName(false), _setThreadName(false)
_pid(-1)
{ {
#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID))
_pid = -1;
#endif
if (threadName != NULL) if (threadName != NULL)
{ {
_setThreadName = true; _setThreadName = true;
@ -279,7 +281,9 @@ void ThreadPosix::Run()
{ {
_alive = true; _alive = true;
_dead = false; _dead = false;
#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID))
_pid = GetThreadId(); _pid = GetThreadId();
#endif
// The event the Start() is waiting for. // The event the Start() is waiting for.
_event->Set(); _event->Set();

View File

@ -59,7 +59,9 @@ private:
// handle to thread // handle to thread
pthread_attr_t _attr; pthread_attr_t _attr;
pthread_t _thread; pthread_t _thread;
#if (defined(WEBRTC_LINUX) || defined(WEBRTC_ANDROID))
pid_t _pid; pid_t _pid;
#endif
}; };
} // namespace webrtc } // namespace webrtc