Chromium Code Reviews| Index: runtime/vm/profiler.cc |
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
| index de2afea156800d813254301cd5df6486242ec88a..57afdd3cc3de27a27d3398560fbe99cff3c4cb54 100644 |
| --- a/runtime/vm/profiler.cc |
| +++ b/runtime/vm/profiler.cc |
| @@ -1585,6 +1585,7 @@ IsolateProfilerData::IsolateProfilerData(SampleBuffer* sample_buffer, |
| ASSERT(sample_buffer != NULL); |
| sample_buffer_ = sample_buffer; |
| own_sample_buffer_ = own_sample_buffer; |
| + block_count_ = 0; |
| } |
| @@ -1597,6 +1598,20 @@ IsolateProfilerData::~IsolateProfilerData() { |
| } |
| +void IsolateProfilerData::Block() { |
| + block_count_++; |
| +} |
| + |
| + |
| +void IsolateProfilerData::Unblock() { |
| + block_count_--; |
|
Ivan Posva
2014/05/25 12:25:16
ASSERT that you are not over unblocking.
Cutch
2014/05/26 06:59:35
Added a FATAL.
|
| + if (!blocked()) { |
| + // We just unblocked this isolate, wake up the thread interrupter. |
| + ThreadInterrupter::WakeUp(); |
| + } |
| +} |
| + |
| + |
| Sample* SampleBuffer::ReserveSample() { |
| ASSERT(samples_ != NULL); |
| uintptr_t cursor = AtomicOperations::FetchAndIncrement(&cursor_); |