From 29948df4ba18ddf4aa078409b29658e451b358e4 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 13 Sep 2021 16:46:23 -0700 Subject: [PATCH] Activities: allow empty wakers (#27335) --- src/core/lib/promise/activity.h | 2 +- test/core/promise/activity_test.cc | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/lib/promise/activity.h b/src/core/lib/promise/activity.h index 6941d98b4ef..e9a1b73fb9e 100644 --- a/src/core/lib/promise/activity.h +++ b/src/core/lib/promise/activity.h @@ -78,7 +78,7 @@ class Waker { private: class Unwakeable final : public Wakeable { public: - void Wakeup() final { abort(); } + void Wakeup() final {} void Drop() final {} }; diff --git a/test/core/promise/activity_test.cc b/test/core/promise/activity_test.cc index 3375b2f4632..854f6549ac1 100644 --- a/test/core/promise/activity_test.cc +++ b/test/core/promise/activity_test.cc @@ -252,6 +252,11 @@ TEST(ActivityTest, WithContext) { EXPECT_TRUE(done); } +TEST(WakerTest, CanWakeupEmptyWaker) { + // Empty wakers should not do anything upon wakeup. + Waker().Wakeup(); +} + } // namespace grpc_core int main(int argc, char** argv) {