fix(tools): use sync.Once for thread-safe Stop() in SessionManager
The Stop() method previously used a select/default pattern which was not safe under concurrent calls — two goroutines could both pass the check and attempt to close the same channel, causing a panic. Replace with sync.Once to guarantee exactly-once close semantics, matching the documented contract of being safe for concurrent use. Review feedback: afjcjsbx
This commit is contained in:
1 parent
bb57e0498c
commit
e70a9fca7c
2 files changed
+7
-9
No files matched your search
@@ -1,4 +1,4 @@
|
||||
package tools
|
||||
package tools
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
Reference in new issue
Block a user