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

Side by Side Diff: runtime/vm/os_thread.cc

Issue 2178693002: Revert "Add new atomic operations and use them in two places." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.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 (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/os_thread.h" 5 #include "vm/os_thread.h"
6 6
7 #include "vm/atomic.h" 7 #include "vm/atomic.h"
8 #include "vm/lockers.h" 8 #include "vm/lockers.h"
9 #include "vm/log.h" 9 #include "vm/log.h"
10 #include "vm/thread_interrupter.h" 10 #include "vm/thread_interrupter.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 } 96 }
97 if (old == 0) { 97 if (old == 0) {
98 // We just decremented from 0, this means we've got a mismatched pair 98 // We just decremented from 0, this means we've got a mismatched pair
99 // of calls to EnableThreadInterrupts and DisableThreadInterrupts. 99 // of calls to EnableThreadInterrupts and DisableThreadInterrupts.
100 FATAL("Invalid call to OSThread::EnableThreadInterrupts()"); 100 FATAL("Invalid call to OSThread::EnableThreadInterrupts()");
101 } 101 }
102 } 102 }
103 103
104 104
105 bool OSThread::ThreadInterruptsEnabled() { 105 bool OSThread::ThreadInterruptsEnabled() {
106 return AtomicOperations::LoadAcquire(&thread_interrupt_disabled_) == 0; 106 return AtomicOperations::LoadRelaxed(&thread_interrupt_disabled_) == 0;
107 } 107 }
108 108
109 109
110 static void DeleteThread(void* thread) { 110 static void DeleteThread(void* thread) {
111 delete reinterpret_cast<OSThread*>(thread); 111 delete reinterpret_cast<OSThread*>(thread);
112 } 112 }
113 113
114 114
115 void OSThread::InitOnce() { 115 void OSThread::InitOnce() {
116 // Allocate the global OSThread lock. 116 // Allocate the global OSThread lock.
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 287
288 OSThread* OSThreadIterator::Next() { 288 OSThread* OSThreadIterator::Next() {
289 ASSERT(OSThread::thread_list_lock_ != NULL); 289 ASSERT(OSThread::thread_list_lock_ != NULL);
290 ASSERT(OSThread::thread_list_lock_->IsOwnedByCurrentThread()); 290 ASSERT(OSThread::thread_list_lock_->IsOwnedByCurrentThread());
291 OSThread* current = next_; 291 OSThread* current = next_;
292 next_ = next_->thread_list_next_; 292 next_ = next_->thread_list_next_;
293 return current; 293 return current;
294 } 294 }
295 295
296 } // namespace dart 296 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698