Skip to content

Commit

Permalink
server: switch the assert to allow child threads. (#31711)
Browse files Browse the repository at this point in the history
switch the assert to allow child threads.

Signed-off-by: Joshua Marantz <[email protected]>
  • Loading branch information
jmarantz authored Jan 10, 2024
1 parent bd1dca3 commit 368dc31
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions source/server/drain_manager_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ bool DrainManagerImpl::drainClose() const {
}

Common::CallbackHandlePtr DrainManagerImpl::addOnDrainCloseCb(DrainCloseCb cb) const {
ASSERT_IS_MAIN_OR_TEST_THREAD();
ASSERT(dispatcher_.isThreadSafe());

if (draining_) {
Expand Down Expand Up @@ -117,7 +116,7 @@ Common::CallbackHandlePtr DrainManagerImpl::addOnDrainCloseCb(DrainCloseCb cb) c
}

void DrainManagerImpl::addDrainCompleteCallback(std::function<void()> cb) {
ASSERT_IS_MAIN_OR_TEST_THREAD();
ASSERT(dispatcher_.isThreadSafe());
ASSERT(draining_);

// If the drain-tick-timer is active, add the callback to the queue. If not defined
Expand All @@ -130,7 +129,7 @@ void DrainManagerImpl::addDrainCompleteCallback(std::function<void()> cb) {
}

void DrainManagerImpl::startDrainSequence(std::function<void()> drain_complete_cb) {
ASSERT_IS_MAIN_OR_TEST_THREAD();
ASSERT(dispatcher_.isThreadSafe());
ASSERT(drain_complete_cb);

// If we've already started draining (either through direct invocation or through
Expand Down

0 comments on commit 368dc31

Please sign in to comment.