| Index: runtime/vm/store_buffer.cc
|
| diff --git a/runtime/vm/store_buffer.cc b/runtime/vm/store_buffer.cc
|
| index f4fbad79f51c17274c5eb471934b049a79ec2675..7fe58c74290511b3938a448735e28b89494a8940 100644
|
| --- a/runtime/vm/store_buffer.cc
|
| +++ b/runtime/vm/store_buffer.cc
|
| @@ -90,7 +90,7 @@ void StoreBuffer::PushBlock(StoreBufferBlock* block, bool check_threshold) {
|
| }
|
|
|
|
|
| -StoreBufferBlock* StoreBuffer::PopBlock() {
|
| +StoreBufferBlock* StoreBuffer::PopNonFullBlock() {
|
| {
|
| MutexLocker ml(mutex_);
|
| if (!partial_.IsEmpty()) {
|
| @@ -112,6 +112,24 @@ StoreBufferBlock* StoreBuffer::PopEmptyBlock() {
|
| }
|
|
|
|
|
| +StoreBufferBlock* StoreBuffer::PopNonEmptyBlock() {
|
| + MutexLocker ml(mutex_);
|
| + if (!full_.IsEmpty()) {
|
| + return full_.Pop();
|
| + } else if (!partial_.IsEmpty()) {
|
| + return partial_.Pop();
|
| + } else {
|
| + return NULL;
|
| + }
|
| +}
|
| +
|
| +
|
| +bool StoreBuffer::IsEmpty() {
|
| + MutexLocker ml(global_mutex_);
|
| + return full_.IsEmpty() && partial_.IsEmpty();
|
| +}
|
| +
|
| +
|
| StoreBuffer::List::~List() {
|
| while (!IsEmpty()) {
|
| delete Pop();
|
|
|