Skip to content

Commit

Permalink
Patch 5.18.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sakno committed Jan 21, 2025
1 parent 19ea862 commit 04b91db
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Release Notes
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.18.0">DotNext.Unsafe 5.18.0</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.threading/5.18.0">DotNext.Threading 5.18.0</a>
<a href="https://www.nuget.org/packages/dotnext.threading/5.18.1">DotNext.Threading 5.18.1</a>
* 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
* * Improved synchronous support for `RandomAccessCache` class

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ Release Date: 01-20-2025
<a href="https://www.nuget.org/packages/dotnext.unsafe/5.18.0">DotNext.Unsafe 5.18.0</a>
* Updated dependencies

<a href="https://www.nuget.org/packages/dotnext.threading/5.18.0">DotNext.Threading 5.18.0</a>
<a href="https://www.nuget.org/packages/dotnext.threading/5.18.1">DotNext.Threading 5.18.1</a>
* 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
* Improved synchronous support for `RandomAccessCache` class

Expand Down
3 changes: 3 additions & 0 deletions src/DotNext.Tests/Threading/AsyncExclusiveLockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,8 @@ public static void ReentrantLock()
False(l.TryAcquire());

Throws<LockRecursionException>(() => l.TryAcquire(DefaultTimeout));

l.Release();
True(l.TryAcquire(DefaultTimeout));
}
}
3 changes: 3 additions & 0 deletions src/DotNext.Tests/Threading/AsyncReaderWriterLockTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -263,5 +263,8 @@ public static void ReentrantLock()

Throws<LockRecursionException>(() => l.TryEnterReadLock(DefaultTimeout));
Throws<LockRecursionException>(() => l.TryEnterWriteLock(DefaultTimeout));

l.Release();
True(l.TryEnterReadLock(DefaultTimeout));
}
}
2 changes: 1 addition & 1 deletion src/DotNext.Threading/DotNext.Threading.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<ImplicitUsings>true</ImplicitUsings>
<IsAotCompatible>true</IsAotCompatible>
<Features>nullablePublicOnly</Features>
<VersionPrefix>5.18.0</VersionPrefix>
<VersionPrefix>5.18.1</VersionPrefix>
<VersionSuffix></VersionSuffix>
<Authors>.NET Foundation and Contributors</Authors>
<Product>.NEXT Family of Libraries</Product>
Expand Down
1 change: 1 addition & 0 deletions src/DotNext.Threading/Threading/AsyncReaderWriterLock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@ public void Release()
throw new SynchronizationLockException(ExceptionMessages.NotInLock);

state.ExitLock();
IsLockHelpByCurrentThread = false;
suspendedCallers = DrainWaitQueue();

if (IsDisposing && IsReadyToDispose)
Expand Down
2 changes: 1 addition & 1 deletion src/DotNext/Func.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public static Func<T> Constant<T>(T obj)
// slow path - allocates a new delegate
return obj is null ? Default<T?>! : obj.UnboxAny<T>;
}

internal static T? Default<T>() => default;

private static T UnboxAny<T>(this object obj)
Expand Down

0 comments on commit 04b91db

Please sign in to comment.