Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: Source/platform/heap/SafePoint.h

Issue 1145423009: Oilpan: simplify away StoppingOtherThreads pseudo GCState. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: revert 'explicit' removal Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
11 namespace blink { 11 namespace blink {
12 12
13 class SafePointScope final { 13 class SafePointScope final {
14 WTF_MAKE_NONCOPYABLE(SafePointScope); 14 WTF_MAKE_NONCOPYABLE(SafePointScope);
15 public: 15 public:
16 explicit SafePointScope(ThreadState::StackState stackState) 16 explicit SafePointScope(ThreadState::StackState stackState, ThreadState* sta te = ThreadState::current())
17 : m_state(ThreadState::current()) 17 : m_state(state)
18 { 18 {
19 RELEASE_ASSERT(!m_state->isAtSafePoint()); 19 if (m_state) {
20 m_state->enterSafePoint(stackState, this); 20 RELEASE_ASSERT(!m_state->isAtSafePoint());
21 m_state->enterSafePoint(stackState, this);
22 }
21 } 23 }
22 24
23 ~SafePointScope() 25 ~SafePointScope()
24 { 26 {
25 if (m_state) 27 if (m_state)
26 m_state->leaveSafePoint(); 28 m_state->leaveSafePoint();
27 } 29 }
28 30
29 private: 31 private:
30 ThreadState* m_state; 32 ThreadState* m_state;
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 volatile int m_canResume; 123 volatile int m_canResume;
122 volatile int m_unparkedThreadCount; 124 volatile int m_unparkedThreadCount;
123 Mutex m_mutex; 125 Mutex m_mutex;
124 ThreadCondition m_parked; 126 ThreadCondition m_parked;
125 ThreadCondition m_resume; 127 ThreadCondition m_resume;
126 }; 128 };
127 129
128 } // namespace blink 130 } // namespace blink
129 131
130 #endif 132 #endif
OLDNEW
« no previous file with comments | « Source/platform/heap/Heap.cpp ('k') | Source/platform/heap/ThreadState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698