From 2dce655ee6955a53859ab66886391adcb8e9df7e Mon Sep 17 00:00:00 2001 From: bochencwx Date: Fri, 26 Jan 2024 15:16:48 +0800 Subject: [PATCH] BugFix: Fix the issue where the unary HTTP server occasionally receives the request packet but fails to trigger the business logic properly when using the fiber thread model --- trpc/coroutine/fiber_blocking_noncontiguous_buffer.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/trpc/coroutine/fiber_blocking_noncontiguous_buffer.h b/trpc/coroutine/fiber_blocking_noncontiguous_buffer.h index 41d1d9e5..59bd1e24 100644 --- a/trpc/coroutine/fiber_blocking_noncontiguous_buffer.h +++ b/trpc/coroutine/fiber_blocking_noncontiguous_buffer.h @@ -145,7 +145,10 @@ class FiberBlockingNoncontiguousBuffer { } void Stop() { - stop_token_ = true; + { + std::lock_guard lk(mutex_); + stop_token_ = true; + } not_full_.notify_one(); not_empty_.notify_one(); }