OSDN Git Service

Fix race in thread list destructor
authorMathieu Chartier <mathieuc@google.com>
Thu, 9 Oct 2014 19:57:58 +0000 (12:57 -0700)
committerMathieu Chartier <mathieuc@google.com>
Thu, 9 Oct 2014 20:43:46 +0000 (13:43 -0700)
commitfec72f4a625122ab9972708b1f44f24b53a8b734
treef996f32dbfc823a7f129208e9deb24263d03c5c1
parenta9b097443f26a6df1a322a8fef50fdd1f26a410b
Fix race in thread list destructor

The ThreadList::Contains wasn't being guarded by the thread list
lock, which could cause a corrupted thread list if another thread
unregistered itself while std::find was searching the thread list.

Bug: 17896374

(cherry picked from commit b90132cb5132eaeb4dbfca1e63d79b4005dacec5)

Change-Id: I8f6f979f365ca00ac0655e04eb26020d2ad7d6ee
runtime/thread_list.cc