badd50f511a57f0817a599a3afc56546a1df1b02
The desired set (assignment lock) and the worker map (workerAccess) were updated in separate critical sections, so a concurrent resync could observe one but not the other: the same busid ended up with two workers (leaking the first cancel), and stop decisions ran against half-applied state. allWorkers is now the single source of truth, diffed, started, and stopped in one workerAccess section; workers remove themselves on exit with an identity check and restart in place if their busid became desired again meanwhile. The per-busid active flag also became a count: during matched-mode handoff two workers briefly reference one busid, and a failing worker's deactivation must not erase the mark of the genuinely attached one (which made ApplyAll detach live devices, oscillating).
sing-box
The universal proxy platform.
Documentation
License
Copyright (C) 2022 by nekohasekai <contact-sagernet@sekai.icu>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
In addition, no derivative work may use the name or imply association
with this application without prior consent.
Description
Languages
Go
97.2%
Shell
1.6%
Objective-C
0.8%
Makefile
0.2%
C
0.2%