Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SafePoint_h | 5 #ifndef SafePoint_h |
| 6 #define SafePoint_h | 6 #define SafePoint_h |
| 7 | 7 |
| 8 #include "platform/heap/ThreadState.h" | 8 #include "platform/heap/ThreadState.h" |
| 9 #include "wtf/ThreadingPrimitives.h" | 9 #include "wtf/ThreadingPrimitives.h" |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 83 m_locked = false; | 83 m_locked = false; |
| 84 } | 84 } |
| 85 | 85 |
| 86 MutexBase& m_mutex; | 86 MutexBase& m_mutex; |
| 87 bool m_locked; | 87 bool m_locked; |
| 88 }; | 88 }; |
| 89 | 89 |
| 90 class SafePointBarrier final { | 90 class SafePointBarrier final { |
| 91 WTF_MAKE_NONCOPYABLE(SafePointBarrier); | 91 WTF_MAKE_NONCOPYABLE(SafePointBarrier); |
| 92 public: | 92 public: |
| 93 SafePointBarrier(); | 93 SafePointBarrier(MultiThreadGCGroup*); |
|
haraken
2016/01/28 15:52:50
Add explicit.
keishi
2016/02/29 06:02:33
Done.
| |
| 94 ~SafePointBarrier(); | 94 ~SafePointBarrier(); |
| 95 | 95 |
| 96 // Request other attached threads that are not at safe points to park | 96 // Request other attached threads that are not at safe points to park |
| 97 // themselves on safepoints. | 97 // themselves on safepoints. |
| 98 bool parkOthers(); | 98 bool parkOthers(); |
| 99 | 99 |
| 100 // Resume executions of other attached threads that are parked at | 100 // Resume executions of other attached threads that are parked at |
| 101 // the safe points. | 101 // the safe points. |
| 102 void resumeOthers(bool barrierLocked = false); | 102 void resumeOthers(bool barrierLocked = false); |
| 103 | 103 |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 118 static void enterSafePointAfterPushRegisters(SafePointBarrier* barrier, Thre adState* state, intptr_t* stackEnd) | 118 static void enterSafePointAfterPushRegisters(SafePointBarrier* barrier, Thre adState* state, intptr_t* stackEnd) |
| 119 { | 119 { |
| 120 barrier->doEnterSafePoint(state, stackEnd); | 120 barrier->doEnterSafePoint(state, stackEnd); |
| 121 } | 121 } |
| 122 | 122 |
| 123 volatile int m_canResume; | 123 volatile int m_canResume; |
| 124 volatile int m_unparkedThreadCount; | 124 volatile int m_unparkedThreadCount; |
| 125 Mutex m_mutex; | 125 Mutex m_mutex; |
| 126 ThreadCondition m_parked; | 126 ThreadCondition m_parked; |
| 127 ThreadCondition m_resume; | 127 ThreadCondition m_resume; |
| 128 MultiThreadGCGroup* m_gcGroup; | |
| 128 }; | 129 }; |
| 129 | 130 |
| 130 } // namespace blink | 131 } // namespace blink |
| 131 | 132 |
| 132 #endif | 133 #endif |
| OLD | NEW |