OSDN Git Service

Move SetMonitorEnterObject outside of blocked thread state change.
authorMathieu Chartier <mathieuc@google.com>
Thu, 22 May 2014 21:43:37 +0000 (14:43 -0700)
committerMathieu Chartier <mathieuc@google.com>
Thu, 22 May 2014 21:43:37 +0000 (14:43 -0700)
commita6e7f0872c42009ecbee82d7fbe452deef9ae65b
tree1ba6d026f6c9a47b9961c62511ab47c6d69314dd
parent697726d42eaf804a1124c25dec58c2b0013a30e9
Move SetMonitorEnterObject outside of blocked thread state change.

Race condition:
Thread is suspended in monitor kBlocked, GC decides to run the
checkpoint on it. The GC sees that the object is non null, and goes
to mark it, but then the thread does SetMonitorObject(nullptr).
Which causes a null object to be marked.

Change-Id: Ie8a5074112947ec07d01ccb813ca2c1bb9ac7066
runtime/monitor.cc
runtime/thread.h