Skip to content

Commit 20eba58

Browse files
committed
docs: add comments
1 parent 6a286d1 commit 20eba58

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

src/Sentry/Internal/StructuredLogBatchBuffer.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ namespace Sentry.Internal;
88
/// <remarks>
99
/// Must be attempted to flush via <see cref="TryEnterFlushScope"/> when either the <see cref="Capacity"/> is reached,
1010
/// or when the <see cref="_timeout"/> is exceeded.
11+
/// Utilizes a <see cref="ScopedCountdownLock"/>, basically used as an inverse <see cref="ReaderWriterLockSlim"/>,
12+
/// allowing multiple threads for <see cref="Add"/> or exclusive access for <see cref="FlushScope.Flush()"/>.
1113
/// </remarks>
1214
[DebuggerDisplay("Name = {Name}, Capacity = {Capacity}, Additions = {_additions}, AddCount = {AddCount}, IsDisposed = {_disposed}")]
1315
internal sealed class StructuredLogBatchBuffer : IDisposable

test/Sentry.Tests/Threading/ScopedCountdownLockTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ public void TryEnterLockScope_IsEngaged_IsSet()
8888
counterTwo.Dispose();
8989
AssertEngaged(false, 1);
9090

91+
// would block if the timeout was infinite because the engaged lock is not yet set
92+
lockOne.Wait(TimeSpan.Zero);
93+
9194
// exit last CounterScope ... count of engaged lock reaches zero ... sets the lock
9295
counterOne.Dispose();
9396
AssertEngaged(true, 0);

0 commit comments

Comments
 (0)