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; }