From b9a1eeb54c164ce926b2136c8fb9d10f87166b97 Mon Sep 17 00:00:00 2001 From: patterniha <71074308+patterniha@users.noreply.github.com> Date: Sun, 6 Jul 2025 18:45:28 +0330 Subject: [PATCH] MUX: ClientWorker-Dispatch needs Thread-Lock --- common/mux/client.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/mux/client.go b/common/mux/client.go index df74ef17..b6148fbc 100644 --- a/common/mux/client.go +++ b/common/mux/client.go @@ -174,6 +174,7 @@ type ClientWorker struct { link transport.Link done *done.Instance strategy ClientStrategy + access sync.Mutex } var ( @@ -289,7 +290,9 @@ func (m *ClientWorker) IsFull() bool { } func (m *ClientWorker) Dispatch(ctx context.Context, link *transport.Link) bool { - if m.IsFull() || m.Closed() { + m.access.Lock() + defer m.access.Unlock() + if m.IsFull() { return false }