Skip to content

Commit 04b91db

Browse files
committed
Patch 5.18.1
1 parent 19ea862 commit 04b91db

File tree

7 files changed

+11
-4
lines changed

7 files changed

+11
-4
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Release Notes
1111
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.18.0">DotNext.Unsafe 5.18.0</a>
1212
* Updated dependencies
1313

14-
<a href="https://www.nuget.org/packages/dotnext.threading/5.18.0">DotNext.Threading 5.18.0</a>
14+
<a href="https://www.nuget.org/packages/dotnext.threading/5.18.1">DotNext.Threading 5.18.1</a>
1515
* Synchronous `TryAcquire` implemented by `AsyncExclusiveLock` and `AsyncReaderWriterLock` are now implemented in portable way. Previously, WASM target was not supported. Additionally, the method supports lock stealing
1616
* * Improved synchronous support for `RandomAccessCache` class
1717

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ Release Date: 01-20-2025
5555
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.18.0">DotNext.Unsafe 5.18.0</a>
5656
* Updated dependencies
5757

58-
<a href="https://www.nuget.org/packages/dotnext.threading/5.18.0">DotNext.Threading 5.18.0</a>
58+
<a href="https://www.nuget.org/packages/dotnext.threading/5.18.1">DotNext.Threading 5.18.1</a>
5959
* Synchronous `TryAcquire` implemented by `AsyncExclusiveLock` and `AsyncReaderWriterLock` are now implemented in portable way. Previously, WASM target was not supported. Additionally, the method supports lock stealing
6060
* Improved synchronous support for `RandomAccessCache` class
6161

src/DotNext.Tests/Threading/AsyncExclusiveLockTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,5 +236,8 @@ public static void ReentrantLock()
236236
False(l.TryAcquire());
237237

238238
Throws<LockRecursionException>(() => l.TryAcquire(DefaultTimeout));
239+
240+
l.Release();
241+
True(l.TryAcquire(DefaultTimeout));
239242
}
240243
}

src/DotNext.Tests/Threading/AsyncReaderWriterLockTests.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,5 +263,8 @@ public static void ReentrantLock()
263263

264264
Throws<LockRecursionException>(() => l.TryEnterReadLock(DefaultTimeout));
265265
Throws<LockRecursionException>(() => l.TryEnterWriteLock(DefaultTimeout));
266+
267+
l.Release();
268+
True(l.TryEnterReadLock(DefaultTimeout));
266269
}
267270
}

src/DotNext.Threading/DotNext.Threading.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<ImplicitUsings>true</ImplicitUsings>
88
<IsAotCompatible>true</IsAotCompatible>
99
<Features>nullablePublicOnly</Features>
10-
<VersionPrefix>5.18.0</VersionPrefix>
10+
<VersionPrefix>5.18.1</VersionPrefix>
1111
<VersionSuffix></VersionSuffix>
1212
<Authors>.NET Foundation and Contributors</Authors>
1313
<Product>.NEXT Family of Libraries</Product>

src/DotNext.Threading/Threading/AsyncReaderWriterLock.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,7 @@ public void Release()
645645
throw new SynchronizationLockException(ExceptionMessages.NotInLock);
646646

647647
state.ExitLock();
648+
IsLockHelpByCurrentThread = false;
648649
suspendedCallers = DrainWaitQueue();
649650

650651
if (IsDisposing && IsReadyToDispose)

src/DotNext/Func.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ public static Func<T> Constant<T>(T obj)
9797
// slow path - allocates a new delegate
9898
return obj is null ? Default<T?>! : obj.UnboxAny<T>;
9999
}
100-
100+
101101
internal static T? Default<T>() => default;
102102

103103
private static T UnboxAny<T>(this object obj)

0 commit comments

Comments
 (0)