mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 12:33:01 +08:00
Use Interlocked.Exhange() instead
Increment isn't correct since it returns the post-incremented value. It also always increments.
This commit is contained in:
parent
e761c0395d
commit
e5f53b1ad8
@ -163,7 +163,7 @@ namespace osu.Game.Overlays.Notifications
|
||||
return;
|
||||
|
||||
// Thread-safe barrier, as this may be called by a web request and also scheduled to the update thread at the same time.
|
||||
if (Interlocked.Increment(ref completionSent) == 0)
|
||||
if (Interlocked.Exchange(ref completionSent, 1) == 0)
|
||||
return;
|
||||
|
||||
CompletionTarget.Invoke(CreateCompletionNotification());
|
||||
|
Loading…
Reference in New Issue
Block a user