aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Taskfile.yaml5
-rw-r--r--lib/Hashing.Portable/src/VNLib.Hashing.Portable.csproj4
-rw-r--r--lib/Net.Compression/VNLib.Net.Compression/VNLib.Net.Compression.csproj15
-rw-r--r--lib/Net.Http/src/VNLib.Net.Http.csproj10
-rw-r--r--lib/Net.Messaging.FBM/src/VNLib.Net.Messaging.FBM.csproj10
-rw-r--r--lib/Net.Rest.Client/src/VNLib.Net.Rest.Client.csproj11
-rw-r--r--lib/Net.Transport.SimpleTCP/src/VNLib.Net.Transport.SimpleTCP.csproj9
-rw-r--r--lib/Plugins.Essentials.ServiceStack/src/VNLib.Plugins.Essentials.ServiceStack.csproj3
-rw-r--r--lib/Plugins.Essentials/src/VNLib.Plugins.Essentials.csproj9
-rw-r--r--lib/Plugins.PluginBase/src/VNLib.Plugins.PluginBase.csproj9
-rw-r--r--lib/Plugins.Runtime/src/VNLib.Plugins.Runtime.csproj9
-rw-r--r--lib/Plugins/src/VNLib.Plugins.csproj9
-rw-r--r--lib/Utils/src/Async/AsyncAccessSerializer.cs88
-rw-r--r--lib/Utils/src/VNLib.Utils.csproj12
14 files changed, 135 insertions, 68 deletions
diff --git a/Taskfile.yaml b/Taskfile.yaml
index 6cd1f0d..08f1c88 100644
--- a/Taskfile.yaml
+++ b/Taskfile.yaml
@@ -49,10 +49,7 @@ tasks:
BUILD_OUT: "{{.USER_WORKING_DIR}}/bin/{{.BUILD_MODE}}/{{.TARGET_FRAMEWORK}}/publish"
cmds:
-
- #copy license and readme to target
- - cd .. && powershell -Command "Copy-Item -Path ./LICENSE -Destination '{{.BUILD_OUT}}/license.txt'"
- - cd .. && powershell -Command "Copy-Item -Path ./build.readme.txt -Destination '{{.BUILD_OUT}}/readme.md'"
+ - cd .. && powershell -Command "Copy-Item -Path ./build.readme.txt -Destination '{{.BUILD_OUT}}/readme.txt'"
#tar outputs
- cd "{{.BUILD_OUT}}" && tar -czf "{{.TARGET}}/{{.BUILD_MODE}}.tgz" .
diff --git a/lib/Hashing.Portable/src/VNLib.Hashing.Portable.csproj b/lib/Hashing.Portable/src/VNLib.Hashing.Portable.csproj
index 21efb3f..8caae03 100644
--- a/lib/Hashing.Portable/src/VNLib.Hashing.Portable.csproj
+++ b/lib/Hashing.Portable/src/VNLib.Hashing.Portable.csproj
@@ -20,6 +20,9 @@
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Hashing.Portable</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup>
@@ -41,6 +44,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Net.Compression/VNLib.Net.Compression/VNLib.Net.Compression.csproj b/lib/Net.Compression/VNLib.Net.Compression/VNLib.Net.Compression.csproj
index e91c640..c6a05cd 100644
--- a/lib/Net.Compression/VNLib.Net.Compression/VNLib.Net.Compression.csproj
+++ b/lib/Net.Compression/VNLib.Net.Compression/VNLib.Net.Compression.csproj
@@ -12,6 +12,9 @@
<!--Enable dynamic loading for debugging-->
<EnableDynamicLoading>true</EnableDynamicLoading>
+ <PackageReadmeFile>readme.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup>
@@ -30,6 +33,18 @@
</PropertyGroup>
<ItemGroup>
+ <None Include="..\LICENSE">
+ <Pack>True</Pack>
+ <PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
+ </None>
+ <None Include="..\readme.md">
+ <Pack>True</Pack>
+ <PackagePath>\</PackagePath>
+ </None>
+ </ItemGroup>
+
+ <ItemGroup>
<ProjectReference Include="..\..\Net.Http\src\VNLib.Net.Http.csproj" />
<ProjectReference Include="..\..\Utils\src\VNLib.Utils.csproj" />
</ItemGroup>
diff --git a/lib/Net.Http/src/VNLib.Net.Http.csproj b/lib/Net.Http/src/VNLib.Net.Http.csproj
index 729fc10..ea0bdb7 100644
--- a/lib/Net.Http/src/VNLib.Net.Http.csproj
+++ b/lib/Net.Http/src/VNLib.Net.Http.csproj
@@ -16,14 +16,13 @@
<Authors>Vaughn Nugent</Authors>
<Company>Vaughn Nugent</Company>
<Product>VNLib HTTP Library</Product>
- <Description>
- Provides a high performance HTTP 0.9-1.1 application processing layer for handling transport *agnostic connections and asynchronous event support for applications serving HTTP
- requests such as web content. This library has a large focus on low/no GC allocations using unmanaged memory support provided by the VNLib.Utils library. No external dependencies
- outside of the VNLib ecosystem are required. The VNLib.Plugins and VNLib.Plugins.Essentials libraries are highly recommended for serving web content.
- </Description>
+ <Description>Provides a high performance HTTP 0.9-1.1 application processing layer for handling transport *agnostic connections and asynchronous event support for applications serving HTTP requests such as web content. This library has a large focus on low/no GC allocations using unmanaged memory support provided by the VNLib.Utils library. No external dependencies outside of the VNLib ecosystem are required. The VNLib.Plugins and VNLib.Plugins.Essentials libraries are highly recommended for serving web content.</Description>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Net.Http</RepositoryUrl>
+ <PackageReadmeFile>readme.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
@@ -61,6 +60,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Net.Messaging.FBM/src/VNLib.Net.Messaging.FBM.csproj b/lib/Net.Messaging.FBM/src/VNLib.Net.Messaging.FBM.csproj
index 8b81d59..7fade2c 100644
--- a/lib/Net.Messaging.FBM/src/VNLib.Net.Messaging.FBM.csproj
+++ b/lib/Net.Messaging.FBM/src/VNLib.Net.Messaging.FBM.csproj
@@ -14,14 +14,13 @@
<PackageId>VNLib.Net.Messaging.FBM</PackageId>
<Authors>Vaughn Nugent</Authors>
<Company>Vaughn Nugent</Company>
- <Description>
- Fixed Buffer Messaging protocol class library. Implements a high-performance asynchronous
- request/response messaging architecture build on top of HTTP websockets. Provides client
- and server data structures.
- </Description>
+ <Description>Fixed Buffer Messaging protocol class library. Implements a high-performance asynchronous request/response messaging architecture build on top of HTTP websockets. Provides client and server data structures.</Description>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Net.Messaging.FBM</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup>
@@ -49,6 +48,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Net.Rest.Client/src/VNLib.Net.Rest.Client.csproj b/lib/Net.Rest.Client/src/VNLib.Net.Rest.Client.csproj
index b0b68ed..552563b 100644
--- a/lib/Net.Rest.Client/src/VNLib.Net.Rest.Client.csproj
+++ b/lib/Net.Rest.Client/src/VNLib.Net.Rest.Client.csproj
@@ -15,14 +15,12 @@
<Company>Vaughn Nugent</Company>
<Authors>Vaughn Nugent</Authors>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
- <Description>
- Provides a RestClient connection pool using the Utils.ObjectRental
- framework for reusing RestClients with a common configuration to execute
- RestRequests against. This library also implements an OAuth2 authenticator
- for the RestSharp IAuthenticator using the client credentials method.
- </Description>
+ <Description>Provides a RestClient connection pool using the Utils.ObjectRental framework for reusing RestClients with a common configuration to execute RestRequests against. This library also implements an OAuth2 authenticator for the RestSharp IAuthenticator using the client credentials method.</Description>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Net.Rest.Client</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -57,6 +55,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Net.Transport.SimpleTCP/src/VNLib.Net.Transport.SimpleTCP.csproj b/lib/Net.Transport.SimpleTCP/src/VNLib.Net.Transport.SimpleTCP.csproj
index 4003666..bfd9fda 100644
--- a/lib/Net.Transport.SimpleTCP/src/VNLib.Net.Transport.SimpleTCP.csproj
+++ b/lib/Net.Transport.SimpleTCP/src/VNLib.Net.Transport.SimpleTCP.csproj
@@ -8,14 +8,14 @@
<GenerateDocumentationFile>True</GenerateDocumentationFile>
<AnalysisLevel>latest-all</AnalysisLevel>
<RunAnalyzersDuringBuild>false</RunAnalyzersDuringBuild>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
</PropertyGroup>
<PropertyGroup>
<Product>VNLib Simple Transport Library</Product>
- <Description>
- Provides a library for single process asynchronous, event driven, TCP socket listening and supporting
- structures to implement simple high performance TCP servers with or without TLS security.
- </Description>
+ <Description>Provides a library for single process asynchronous, event driven, TCP socket listening and supporting structures to implement simple high performance TCP servers with or without TLS security.</Description>
<Authors>Vaughn Nugent</Authors>
<Company>Vaughn Nugent</Company>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
@@ -47,6 +47,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Plugins.Essentials.ServiceStack/src/VNLib.Plugins.Essentials.ServiceStack.csproj b/lib/Plugins.Essentials.ServiceStack/src/VNLib.Plugins.Essentials.ServiceStack.csproj
index afc4774..8fd7e77 100644
--- a/lib/Plugins.Essentials.ServiceStack/src/VNLib.Plugins.Essentials.ServiceStack.csproj
+++ b/lib/Plugins.Essentials.ServiceStack/src/VNLib.Plugins.Essentials.ServiceStack.csproj
@@ -22,6 +22,8 @@
</Description>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Plugins.Essentials.ServiceStack</RepositoryUrl>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -40,6 +42,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Plugins.Essentials/src/VNLib.Plugins.Essentials.csproj b/lib/Plugins.Essentials/src/VNLib.Plugins.Essentials.csproj
index 805f151..47fd60d 100644
--- a/lib/Plugins.Essentials/src/VNLib.Plugins.Essentials.csproj
+++ b/lib/Plugins.Essentials/src/VNLib.Plugins.Essentials.csproj
@@ -16,13 +16,13 @@
<PackageId>VNLib.Plugins.Essentials</PackageId>
<Product>VNLib Essentials Plugin Library</Product>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
- <Description>
- Provides essential web, sessions, users abstractions for building extensable web applications
- with satefull sessions, user based intraction with login and account security extensions.
- </Description>
+ <Description>Provides essential web, sessions, users abstractions for building extensable web applications with satefull sessions, user based intraction with login and account security extensions.</Description>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<PackageTags>VNLib, Plugins, VNLib.Plugins.Essentials, Essentials, Essential Plugins, HTTP Essentials, OAuth2</PackageTags>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Plugins.Essentials</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -51,6 +51,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Plugins.PluginBase/src/VNLib.Plugins.PluginBase.csproj b/lib/Plugins.PluginBase/src/VNLib.Plugins.PluginBase.csproj
index 8655615..b9d671d 100644
--- a/lib/Plugins.PluginBase/src/VNLib.Plugins.PluginBase.csproj
+++ b/lib/Plugins.PluginBase/src/VNLib.Plugins.PluginBase.csproj
@@ -14,12 +14,12 @@
<Company>Vaughn Nugent</Company>
<PackageId>VNLib.Plugins.PluginBase</PackageId>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
- <Description>
- A base class for VNLib.Plugins that provides all supported loading functionalities,
- with built-in logging, loading, task-managment and endpoint routing.
- </Description>
+ <Description>A base class for VNLib.Plugins that provides all supported loading functionalities, with built-in logging, loading, task-managment and endpoint routing.</Description>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Plugins.PluginBase</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -59,6 +59,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Plugins.Runtime/src/VNLib.Plugins.Runtime.csproj b/lib/Plugins.Runtime/src/VNLib.Plugins.Runtime.csproj
index ab8f547..c3e58f3 100644
--- a/lib/Plugins.Runtime/src/VNLib.Plugins.Runtime.csproj
+++ b/lib/Plugins.Runtime/src/VNLib.Plugins.Runtime.csproj
@@ -15,12 +15,12 @@
<Company>Vaughn Nugent</Company>
<PackageId>VNLib.Plugins.Runtime</PackageId>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
- <Description>
- A runtime plugin loader for .NET. Allows runtime loading and tracking of .NET assemblies
- that export the VNLib.Plugin.IPlugin interface.
- </Description>
+ <Description>A runtime plugin loader for .NET. Allows runtime loading and tracking of .NET assemblies that export the VNLib.Plugin.IPlugin interface.</Description>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Plugins.Runtime</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
@@ -54,6 +54,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Plugins/src/VNLib.Plugins.csproj b/lib/Plugins/src/VNLib.Plugins.csproj
index e9aa10e..05f57d3 100644
--- a/lib/Plugins/src/VNLib.Plugins.csproj
+++ b/lib/Plugins/src/VNLib.Plugins.csproj
@@ -17,13 +17,13 @@
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
<PackageTags>Plugins, VNLIb, VNLib Plugins, Plugin Base</PackageTags>
<Product>VNLib Plugins Interface Assembly</Product>
- <Description>
- Provides a standard interface for building dynamically loadable
- plugins and asynchronus web endpoint processing, compatible
- with the VNLib.Plugins.Runtime loader library.
+ <Description>Provides a standard interface for building dynamically loadable plugins and asynchronus web endpoint processing, compatible with the VNLib.Plugins.Runtime loader library.
</Description>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Plugins</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup>
@@ -45,6 +45,7 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
diff --git a/lib/Utils/src/Async/AsyncAccessSerializer.cs b/lib/Utils/src/Async/AsyncAccessSerializer.cs
index bdd8114..fa164ac 100644
--- a/lib/Utils/src/Async/AsyncAccessSerializer.cs
+++ b/lib/Utils/src/Async/AsyncAccessSerializer.cs
@@ -177,38 +177,47 @@ namespace VNLib.Utils.Async
*
* When there are no more waiters for a moniker at the time the lock was entered, the WaitEntry is released
* back to the pool.
- */
+ *
+ * Since tasks are cancellable by another thread at any time, it is possible that the canceled task will be
+ * dequeued as the next task to transition. This condition is guarded by the release token by returning a boolean
+ * signalling the transition failure, if so, must repeat the release process, until a valid release occurs
+ * or the final release is issued.
+ */
WaitReleaseToken releaser;
- lock (StoreLock)
+ do
{
- WaitEntry entry = WaitTable[moniker];
-
- //Call release while holding store lock
- if (entry.ExitWait(out releaser) == 0)
+ lock (StoreLock)
{
- //No more waiters
- WaitTable.Remove(moniker);
+ WaitEntry entry = WaitTable[moniker];
+
+ //Call release while holding store lock
+ if (entry.ExitWait(out releaser) == 0)
+ {
+ //No more waiters
+ WaitTable.Remove(moniker);
- /*
- * We must release the semaphore before returning to pool,
- * its safe because there are no more waiters
- */
+ /*
+ * We must release the semaphore before returning to pool,
+ * its safe because there are no more waiters
+ */
- Debug.Assert(!releaser.WillTransition, "The wait entry referrence count was 0 but a release token was issued that would cause a lock transision");
+ Debug.Assert(!releaser.WillTransition, "The wait entry referrence count was 0 but a release token was issued that would cause a lock transision");
- releaser.Release();
+ releaser.Release();
- ReturnEntry(entry);
+ ReturnEntry(entry);
- //already released
- releaser = default;
+ return;
+ }
}
- }
- //Release sem outside of lock
- releaser.Release();
+ /*
+ * If the releaser fails to transition the next task, we need to repeat the
+ * release process to ensure that at least one waiter is properly released
+ */
+ } while (!releaser.Release());
}
@@ -483,9 +492,44 @@ namespace VNLib.Utils.Async
/// <summary>
/// Releases the exclusive lock held by the token. NOTE:
/// this method may only be called ONCE after a wait has been
- /// released
+ /// released.
+ /// <para>
+ /// If <see cref="WillTransition"/> is true, this method may cause a waiting
+ /// task to transition. The result must be examined to determine if the
+ /// transition was successful.If a transition is not successful, then a deadlock may occur if
+ /// another waiter is not selected.
+ /// </para>
/// </summary>
- public readonly void Release() => _nextWaiter?.Start();
+ /// <returns>A value that indicates if the task was transition successfully</returns>
+ public readonly bool Release()
+ {
+ //return success if no next waiter
+ if(_nextWaiter == null)
+ {
+ return true;
+ }
+
+ /*
+ * Guard against the next waiter being cancelled,
+ * this thread could be suspended after this check
+ * but for now should be good enough. An exception
+ * will be thrown if this doesnt work
+ */
+
+ if (_nextWaiter.Status == TaskStatus.Created)
+ {
+ _nextWaiter.Start();
+ return true;
+ }
+
+ if(_nextWaiter.Status == TaskStatus.Canceled)
+ {
+ return false;
+ }
+
+ Debug.Fail($"Next waiting task is in an invalid state: {_nextWaiter.Status}");
+ return false;
+ }
}
/// <summary>
diff --git a/lib/Utils/src/VNLib.Utils.csproj b/lib/Utils/src/VNLib.Utils.csproj
index 404beaa..d121183 100644
--- a/lib/Utils/src/VNLib.Utils.csproj
+++ b/lib/Utils/src/VNLib.Utils.csproj
@@ -17,13 +17,12 @@
<Company>Vaughn Nugent</Company>
<Product>VNLib Utilities Library</Product>
<Copyright>Copyright © 2023 Vaughn Nugent</Copyright>
- <Description>
- .NET/6.0 Utilities library for high-performance common operations. Utilities and abstractions for building and
- diagnosing native memory implementations. Dyanmic native library loading, IO, extensions, data encoding, resource
- access, and asynchronous cooperation primitives.
- </Description>
+ <Description>.NET/6.0 Utilities library for high-performance common operations. Utilities and abstractions for building and diagnosing native memory implementations. Dyanmic native library loading, IO, extensions, data encoding, resource access, and asynchronous cooperation primitives.</Description>
<PackageProjectUrl>https://www.vaughnnugent.com/resources/software/modules/VNLib.Core</PackageProjectUrl>
<RepositoryUrl>https://github.com/VnUgE/VNLib.Core/tree/main/lib/Utils</RepositoryUrl>
+ <PackageReadmeFile>README.md</PackageReadmeFile>
+ <PackageLicenseFile>LICENSE</PackageLicenseFile>
+ <PackageRequireLicenseAcceptance>True</PackageRequireLicenseAcceptance>
</PropertyGroup>
<ItemGroup>
@@ -34,9 +33,10 @@
<None Include="..\LICENSE">
<Pack>True</Pack>
<PackagePath>\</PackagePath>
+ <CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
-
+
<PropertyGroup Condition="'$(Configuration)'=='Debug'">
<CheckForOverflowUnderflow>true</CheckForOverflowUnderflow>
</PropertyGroup>