| OLD | NEW |
| 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 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 OSThread::~OSThread() { | 38 OSThread::~OSThread() { |
| 39 RemoveThreadFromList(this); | 39 RemoveThreadFromList(this); |
| 40 delete log_; | 40 delete log_; |
| 41 log_ = NULL; | 41 log_ = NULL; |
| 42 if (Timeline::recorder() != NULL) { | 42 if (Timeline::recorder() != NULL) { |
| 43 Timeline::recorder()->FinishBlock(timeline_block_); | 43 Timeline::recorder()->FinishBlock(timeline_block_); |
| 44 } | 44 } |
| 45 timeline_block_ = NULL; | 45 timeline_block_ = NULL; |
| 46 delete timeline_block_lock_; | 46 delete timeline_block_lock_; |
| 47 free(name_); |
| 47 } | 48 } |
| 48 | 49 |
| 49 | 50 |
| 50 void OSThread::DisableThreadInterrupts() { | 51 void OSThread::DisableThreadInterrupts() { |
| 51 ASSERT(OSThread::Current() == this); | 52 ASSERT(OSThread::Current() == this); |
| 52 AtomicOperations::FetchAndIncrement(&thread_interrupt_disabled_); | 53 AtomicOperations::FetchAndIncrement(&thread_interrupt_disabled_); |
| 53 } | 54 } |
| 54 | 55 |
| 55 | 56 |
| 56 void OSThread::EnableThreadInterrupts() { | 57 void OSThread::EnableThreadInterrupts() { |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 223 |
| 223 OSThread* OSThreadIterator::Next() { | 224 OSThread* OSThreadIterator::Next() { |
| 224 ASSERT(OSThread::thread_list_lock_ != NULL); | 225 ASSERT(OSThread::thread_list_lock_ != NULL); |
| 225 ASSERT(OSThread::thread_list_lock_->IsOwnedByCurrentThread()); | 226 ASSERT(OSThread::thread_list_lock_->IsOwnedByCurrentThread()); |
| 226 OSThread* current = next_; | 227 OSThread* current = next_; |
| 227 next_ = next_->thread_list_next_; | 228 next_ = next_->thread_list_next_; |
| 228 return current; | 229 return current; |
| 229 } | 230 } |
| 230 | 231 |
| 231 } // namespace dart | 232 } // namespace dart |
| OLD | NEW |