OSDN Git Service

Change Checkpoint API to return total number of checkpoints
authorMathieu Chartier <mathieuc@google.com>
Thu, 29 Oct 2015 01:36:09 +0000 (18:36 -0700)
committerMathieu Chartier <mathieuc@google.com>
Thu, 29 Oct 2015 02:24:54 +0000 (19:24 -0700)
commit10d2508b105427ef1bcaf0c222873bae7acc66d3
tree8aa018dd07a1d84daf9f44ea7bb1c02442c44097
parent5f2e628b280dfc5f8385e489d44cc0960fcea484
Change Checkpoint API to return total number of checkpoints

Fixes a race condition with SetStateUnsafe that caused some
warnings in the Barrier::~Barrier.

The race was:
RunCheckpoint sees suspended thread, runs the checkpoint. Inside the
checkpoint, the thread state had changed to runnable by
SetStateUnsafe. This occasionally caused more Barrier::Pass than
expected.

The fix is to return the total number of checkpoints instead of just
the runnable ones.

Bug: 24191051
Change-Id: If15a933ed4c8efa66a5f27cd5feaa2e5957ae804
runtime/gc/collector/concurrent_copying.cc
runtime/gc/collector/mark_sweep.cc
runtime/gc/heap.cc
runtime/jit/jit_code_cache.cc
runtime/thread_list.cc
runtime/thread_list.h