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/thread.h" | 5 #include "vm/thread.h" |
6 | 6 |
7 #include "vm/compiler_stats.h" | 7 #include "vm/compiler_stats.h" |
8 #include "vm/dart_api_state.h" | 8 #include "vm/dart_api_state.h" |
9 #include "vm/growable_array.h" | 9 #include "vm/growable_array.h" |
10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 ASSERT(!value.IsNull()); | 267 ASSERT(!value.IsNull()); |
268 sticky_error_ = value.raw(); | 268 sticky_error_ = value.raw(); |
269 } | 269 } |
270 | 270 |
271 | 271 |
272 void Thread::clear_sticky_error() { | 272 void Thread::clear_sticky_error() { |
273 sticky_error_ = Error::null(); | 273 sticky_error_ = Error::null(); |
274 } | 274 } |
275 | 275 |
276 | 276 |
277 RawError* Thread::get_and_clear_sticky_error() { | |
siva
2017/03/16 23:02:30
NoSafepointScope here as a raw pointer is being he
Cutch
2017/03/20 17:45:26
Done.
| |
278 RawError* return_value = sticky_error_; | |
279 sticky_error_ = Error::null(); | |
280 return return_value; | |
281 } | |
282 | |
283 | |
277 const char* Thread::TaskKindToCString(TaskKind kind) { | 284 const char* Thread::TaskKindToCString(TaskKind kind) { |
278 switch (kind) { | 285 switch (kind) { |
279 case kUnknownTask: | 286 case kUnknownTask: |
280 return "kUnknownTask"; | 287 return "kUnknownTask"; |
281 case kMutatorTask: | 288 case kMutatorTask: |
282 return "kMutatorTask"; | 289 return "kMutatorTask"; |
283 case kCompilerTask: | 290 case kCompilerTask: |
284 return "kCompilerTask"; | 291 return "kCompilerTask"; |
285 case kSweeperTask: | 292 case kSweeperTask: |
286 return "kSweeperTask"; | 293 return "kSweeperTask"; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
899 | 906 |
900 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { | 907 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { |
901 if (thread() != NULL) { | 908 if (thread() != NULL) { |
902 OSThread* os_thread = thread()->os_thread(); | 909 OSThread* os_thread = thread()->os_thread(); |
903 ASSERT(os_thread != NULL); | 910 ASSERT(os_thread != NULL); |
904 os_thread->EnableThreadInterrupts(); | 911 os_thread->EnableThreadInterrupts(); |
905 } | 912 } |
906 } | 913 } |
907 | 914 |
908 } // namespace dart | 915 } // namespace dart |
OLD | NEW |