Chromium Code Reviews| Index: Source/platform/heap/ThreadState.h |
| diff --git a/Source/platform/heap/ThreadState.h b/Source/platform/heap/ThreadState.h |
| index ee55938a23a43ebaaa05e2493daf6b03f8d1c6a5..5269820c6417a1cff55af4d7d8237da95eed2fb1 100644 |
| --- a/Source/platform/heap/ThreadState.h |
| +++ b/Source/platform/heap/ThreadState.h |
| @@ -617,7 +617,11 @@ public: |
| ThreadState* state = ThreadState::current(); |
| do { |
| bool leaveSafePoint = false; |
| - if (!state->isAtSafePoint()) { |
| + // We cannot enter a safepoint if we are currently sweeping. In that |
| + // case we just try to acquire the lock without being at a safepoint. |
| + // If another thread tries to do a GC at that time it might time out |
| + // due to this thread not being at a safepoint and waiting on the lock. |
|
haraken
2014/07/01 10:35:10
Would you elaborate on why this doesn't cause dead
|
| + if (!state->isSweepInProgress() && !state->isAtSafePoint()) { |
| state->enterSafePoint(ThreadState::HeapPointersOnStack, this); |
| leaveSafePoint = true; |
| } |