Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix(logs): race condition when flushing Batch-Buffer
  • Loading branch information
Flash0ver committed Aug 10, 2025
commit 17bbed7ed2be144ad00271fc1fa3daaccdc8efed
9 changes: 4 additions & 5 deletions src/Sentry/Threading/ScopedCountdownLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,12 @@ internal LockScope TryEnterLockScope()

private void ExitLockScope()
{
if (Interlocked.CompareExchange(ref _isEngaged, 0, 1) == 1)
_event.Reset(); // reset the signaled event to the initial count of 1, so that new `CounterScope`s can be entered again

if (Interlocked.CompareExchange(ref _isEngaged, 0, 1) != 1)
{
_event.Reset(); // reset the signaled event to the initial count of 1, so that new `CounterScope`s can be entered again
return;
Debug.Fail("The Lock should have not been disengaged without being engaged first.");
}

Debug.Fail("The Lock should have not been disengaged without being engaged first.");
}

/// <inheritdoc />
Expand Down