From 0aa4c56451d5727c8016245de57672197e5f196b Mon Sep 17 00:00:00 2001 From: sakno Date: Wed, 4 Dec 2024 18:15:19 +0200 Subject: [PATCH] Fixed regression --- src/DotNext.Tests/Threading/AsyncReaderWriterLockTests.cs | 4 +--- src/DotNext/Buffers/ByteBuffer.cs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/DotNext.Tests/Threading/AsyncReaderWriterLockTests.cs b/src/DotNext.Tests/Threading/AsyncReaderWriterLockTests.cs index cfd08bda0..7507e1e21 100644 --- a/src/DotNext.Tests/Threading/AsyncReaderWriterLockTests.cs +++ b/src/DotNext.Tests/Threading/AsyncReaderWriterLockTests.cs @@ -226,12 +226,10 @@ public static async Task AcquireReadWriteLockSynchronously() { using var l = new AsyncReaderWriterLock(); True(l.TryEnterReadLock(DefaultTimeout)); - True(l.TryEnterReadLock(DefaultTimeout)); - Equal(2L, l.CurrentReadCount); + Equal(1L, l.CurrentReadCount); var t = Task.Factory.StartNew(() => l.TryEnterWriteLock(DefaultTimeout), TaskCreationOptions.LongRunning); - l.Release(); l.Release(); True(await t); diff --git a/src/DotNext/Buffers/ByteBuffer.cs b/src/DotNext/Buffers/ByteBuffer.cs index cfe08725d..cf3c9845a 100644 --- a/src/DotNext/Buffers/ByteBuffer.cs +++ b/src/DotNext/Buffers/ByteBuffer.cs @@ -357,7 +357,7 @@ public static T Read7BitEncodedInteger(this ref SpanReader reader) do { octet = reader.Read(); - } while (!decoder.Append(octet)); + } while (decoder.Append(octet)); return decoder.Value; }