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 #include "platform/heap/SafePoint.h" | 5 #include "platform/heap/SafePoint.h" |
6 | 6 |
7 #include "wtf/Atomics.h" | 7 #include "wtf/Atomics.h" |
| 8 #include "wtf/CurrentTime.h" |
8 | 9 |
9 namespace blink { | 10 namespace blink { |
10 | 11 |
11 using PushAllRegistersCallback = void (*)(SafePointBarrier*, ThreadState*, intpt
r_t*); | 12 using PushAllRegistersCallback = void (*)(SafePointBarrier*, ThreadState*, intpt
r_t*); |
12 extern "C" void pushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegiste
rsCallback); | 13 extern "C" void pushAllRegisters(SafePointBarrier*, ThreadState*, PushAllRegiste
rsCallback); |
13 | 14 |
14 static double lockingTimeout() | 15 static double lockingTimeout() |
15 { | 16 { |
16 // Wait time for parking all threads is at most 100 ms. | 17 // Wait time for parking all threads is at most 100 ms. |
17 return 0.100; | 18 return 0.100; |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // If no other thread is waiting for other threads to park then | 131 // If no other thread is waiting for other threads to park then |
131 // this counter can be negative: if N threads are at safe-points | 132 // this counter can be negative: if N threads are at safe-points |
132 // the counter will be -N. | 133 // the counter will be -N. |
133 if (!atomicDecrement(&m_unparkedThreadCount)) { | 134 if (!atomicDecrement(&m_unparkedThreadCount)) { |
134 MutexLocker locker(m_mutex); | 135 MutexLocker locker(m_mutex); |
135 m_parked.signal(); // Safe point reached. | 136 m_parked.signal(); // Safe point reached. |
136 } | 137 } |
137 } | 138 } |
138 | 139 |
139 } // namespace blink | 140 } // namespace blink |
OLD | NEW |