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() { |
| 278 NoSafepointScope nss; |
| 279 RawError* return_value = sticky_error_; |
| 280 sticky_error_ = Error::null(); |
| 281 return return_value; |
| 282 } |
| 283 |
| 284 |
277 const char* Thread::TaskKindToCString(TaskKind kind) { | 285 const char* Thread::TaskKindToCString(TaskKind kind) { |
278 switch (kind) { | 286 switch (kind) { |
279 case kUnknownTask: | 287 case kUnknownTask: |
280 return "kUnknownTask"; | 288 return "kUnknownTask"; |
281 case kMutatorTask: | 289 case kMutatorTask: |
282 return "kMutatorTask"; | 290 return "kMutatorTask"; |
283 case kCompilerTask: | 291 case kCompilerTask: |
284 return "kCompilerTask"; | 292 return "kCompilerTask"; |
285 case kSweeperTask: | 293 case kSweeperTask: |
286 return "kSweeperTask"; | 294 return "kSweeperTask"; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 | 907 |
900 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { | 908 DisableThreadInterruptsScope::~DisableThreadInterruptsScope() { |
901 if (thread() != NULL) { | 909 if (thread() != NULL) { |
902 OSThread* os_thread = thread()->os_thread(); | 910 OSThread* os_thread = thread()->os_thread(); |
903 ASSERT(os_thread != NULL); | 911 ASSERT(os_thread != NULL); |
904 os_thread->EnableThreadInterrupts(); | 912 os_thread->EnableThreadInterrupts(); |
905 } | 913 } |
906 } | 914 } |
907 | 915 |
908 } // namespace dart | 916 } // namespace dart |
OLD | NEW |