OSDN Git Service

Merge from open-source gingerbread
authorJean-Baptiste Queru <jbq@google.com>
Sun, 30 Jan 2011 23:29:52 +0000 (15:29 -0800)
committerJean-Baptiste Queru <jbq@google.com>
Sun, 30 Jan 2011 23:30:03 +0000 (15:30 -0800)
Change-Id: I56f2ed37187796807fbf0de15274a85164f9432c

1  2 
libs/utils/Threads.cpp

@@@ -774,10 -774,8 +774,11 @@@ int Thread::_threadLoop(void* user
              self->mExitPending = true;
              self->mLock.lock();
              self->mRunning = false;
 +            // clear thread ID so that requestExitAndWait() does not exit if
 +            // called by a new thread using the same thread ID as this one.
 +            self->mThread = thread_id_t(-1);
              self->mThreadExitedCondition.broadcast();
+             self->mThread = thread_id_t(-1); // thread id could be reused
              self->mLock.unlock();
              break;
          }