diff --git a/src/core/lib/iomgr/executor/mpmcqueue.h b/src/core/lib/iomgr/executor/mpmcqueue.h index 2af56903bc8..46e88b8c9dc 100644 --- a/src/core/lib/iomgr/executor/mpmcqueue.h +++ b/src/core/lib/iomgr/executor/mpmcqueue.h @@ -42,7 +42,7 @@ class MPMCQueueInterface { // Removes the oldest element from the queue and return it. // This might cause to block on empty queue depending on implementation. // Optional argument for collecting stats purpose. - virtual void* Get(gpr_timespec* wait_time = nullptr) = 0; + virtual void* Get(gpr_timespec* wait_time) = 0; // Returns number of elements in the queue currently virtual int count() const = 0; @@ -65,7 +65,7 @@ class InfLenFIFOQueue : public MPMCQueueInterface { // This routine will cause the thread to block if queue is currently empty. // Argument wait_time should be passed in when trace flag turning on (for // collecting stats info purpose.) - void* Get(gpr_timespec* wait_time = nullptr) override; + void* Get(gpr_timespec* wait_time) override; // Returns number of elements in queue currently. // There might be concurrently add/remove on queue, so count might change diff --git a/test/core/iomgr/mpmcqueue_test.cc b/test/core/iomgr/mpmcqueue_test.cc index 9c3d2210dee..93beb663b01 100644 --- a/test/core/iomgr/mpmcqueue_test.cc +++ b/test/core/iomgr/mpmcqueue_test.cc @@ -93,7 +93,7 @@ class ConsumerThread { int count = 0; WorkItem* item; - while ((item = static_cast(queue_->Get())) != nullptr) { + while ((item = static_cast(queue_->Get(nullptr))) != nullptr) { count++; GPR_ASSERT(!item->done); item->done = true; @@ -113,7 +113,7 @@ static void test_FIFO(void) { } GPR_ASSERT(large_queue.count() == TEST_NUM_ITEMS); for (int i = 0; i < TEST_NUM_ITEMS; ++i) { - WorkItem* item = static_cast(large_queue.Get()); + WorkItem* item = static_cast(large_queue.Get(nullptr)); GPR_ASSERT(i == item->index); delete item; } @@ -130,12 +130,12 @@ static void test_space_efficiency(void) { // Queue should not have been expanded at this time. GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes()); for (int i = 0; i < queue.init_num_nodes(); ++i) { - WorkItem* item = static_cast(queue.Get()); + WorkItem* item = static_cast(queue.Get(nullptr)); queue.Put(item); } GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes()); for (int i = 0; i < queue.init_num_nodes(); ++i) { - WorkItem* item = static_cast(queue.Get()); + WorkItem* item = static_cast(queue.Get(nullptr)); delete item; } // Queue never shrinks even it is empty. @@ -149,7 +149,7 @@ static void test_space_efficiency(void) { // Queue should have been expanded once. GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes() * 2); for (int i = 0; i < queue.init_num_nodes(); ++i) { - WorkItem* item = static_cast(queue.Get()); + WorkItem* item = static_cast(queue.Get(nullptr)); delete item; } GPR_ASSERT(queue.count() == queue.init_num_nodes()); @@ -162,7 +162,7 @@ static void test_space_efficiency(void) { // Queue should have been expanded twice. GPR_ASSERT(queue.num_nodes() == queue.init_num_nodes() * 4); for (int i = 0; i < queue.init_num_nodes() * 2 + 1; ++i) { - WorkItem* item = static_cast(queue.Get()); + WorkItem* item = static_cast(queue.Get(nullptr)); delete item; } GPR_ASSERT(queue.count() == 0);