Index: runtime/vm/os_thread.cc |
diff --git a/runtime/vm/os_thread.cc b/runtime/vm/os_thread.cc |
index 0dcd50602a67d93bdba284f8b3da1e2aa305ce48..03031617cdb8eb8a700edba44bb764538ce4884b 100644 |
--- a/runtime/vm/os_thread.cc |
+++ b/runtime/vm/os_thread.cc |
@@ -51,8 +51,10 @@ OSThread::~OSThread() { |
RemoveThreadFromList(this); |
delete log_; |
log_ = NULL; |
- if (Timeline::recorder() != NULL) { |
- Timeline::recorder()->FinishBlock(timeline_block_); |
+ if (FLAG_support_timeline) { |
+ if (Timeline::recorder() != NULL) { |
+ Timeline::recorder()->FinishBlock(timeline_block_); |
+ } |
} |
timeline_block_ = NULL; |
delete timeline_block_lock_; |
@@ -70,7 +72,7 @@ void OSThread::EnableThreadInterrupts() { |
ASSERT(OSThread::Current() == this); |
uintptr_t old = |
AtomicOperations::FetchAndDecrement(&thread_interrupt_disabled_); |
- if (old == 1) { |
+ if (FLAG_profiler && (old == 1)) { |
// We just decremented from 1 to 0. |
// Make sure the thread interrupter is awake. |
ThreadInterrupter::WakeUp(); |