From 334c1d957252fa37bf797346486e4d336198fd9f Mon Sep 17 00:00:00 2001 From: tqcq Date: Wed, 13 Dec 2023 13:13:31 +0800 Subject: [PATCH] fix delete operator() for Event --- src/ulib/concorrency/event.cpp | 8 +------- src/ulib/concorrency/event.h | 3 +-- tests/ulib/concorrency/event_test.cpp | 1 - 3 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/ulib/concorrency/event.cpp b/src/ulib/concorrency/event.cpp index 3127573..8024ab8 100644 --- a/src/ulib/concorrency/event.cpp +++ b/src/ulib/concorrency/event.cpp @@ -49,16 +49,10 @@ ulib::Event::Wait(int give_up_after_ms) } } -bool -ulib::Event::operator()() const -{ - return event_status_; -} - ulib::Event::IsEventSetChecker::IsEventSetChecker(const ulib::Event &event) : event_(event) {} bool -ulib::Event::IsEventSetChecker::operator()() +ulib::Event::IsEventSetChecker::operator()() const { return event_.event_status_; } diff --git a/src/ulib/concorrency/event.h b/src/ulib/concorrency/event.h index a0fd184..a348c81 100644 --- a/src/ulib/concorrency/event.h +++ b/src/ulib/concorrency/event.h @@ -23,13 +23,12 @@ public: * @return */ bool Wait(int give_up_after_ms = -1); - bool operator()() const; private: class IsEventSetChecker { public: IsEventSetChecker(const Event &); - bool operator()(); + bool operator()() const; private: const Event &event_; diff --git a/tests/ulib/concorrency/event_test.cpp b/tests/ulib/concorrency/event_test.cpp index d73ca51..5115f70 100644 --- a/tests/ulib/concorrency/event_test.cpp +++ b/tests/ulib/concorrency/event_test.cpp @@ -10,7 +10,6 @@ class EventTest : public ::testing::Test { public: void SetUp() override { - EXPECT_FALSE(event_()); EXPECT_FALSE(event_.Wait(100)); consumer_count_ = 0;