mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-07-25 19:34:14 +00:00
MUX: ClientWorker-Dispatch needs Thread-Lock
This commit is contained in:
parent
cb1afb33e6
commit
b9a1eeb54c
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue