diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-11-08 10:15:14 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-11-08 10:15:14 -0600 |
| commit | 169bb8a3c0098599a617d8553e93c694bd813795 (patch) | |
| tree | 4d825302717fc76d543b6a24469ad23a605cd5c8 /src/slskd/Common/RateLimiter.cs | |
| parent | 4eaa2b13e2da250d7b89073a15e9f1e077661fd7 (diff) | |
| parent | cefdcd02e28b1f02f546002fdd475de4fa03e839 (diff) | |
| download | slskd-169bb8a3c0098599a617d8553e93c694bd813795.tar.gz | |
Merge branch 'master' into dependabot/npm_and_yarn/src/web/follow-redirects-1.16.2
Diffstat (limited to 'src/slskd/Common/RateLimiter.cs')
| -rw-r--r-- | src/slskd/Common/RateLimiter.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/slskd/Common/RateLimiter.cs b/src/slskd/Common/RateLimiter.cs index ac34ed5d..7229441f 100644 --- a/src/slskd/Common/RateLimiter.cs +++ b/src/slskd/Common/RateLimiter.cs @@ -97,6 +97,7 @@ namespace slskd return; } + // previously staged action is lost, intentionally Staged = action; } @@ -131,8 +132,11 @@ namespace slskd { try { - Staged?.Invoke(); + // capture the staged action before nulling it to avoid + // a race where another action might slip in between the invoke and null + var staged = Staged; Staged = null; + staged?.Invoke(); } finally { |
