wait 1.0.0

An obsessively simple and performant library for protecting critical sections.

Install-Package wait -Version 1.0.0
dotnet add package wait --version 1.0.0
<PackageReference Include="wait" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add wait --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

wait

An obsessively simple and performant library for protecting critical sections.

NuGet

Let's look at some examples! Wait can be used using Wait.On() or Wait.GetWaiter().

Wait.On()
Wait.On("critical section", () =>
{
	// Critical Section
	// Only one "critical section" will run at a time
});

new Thread(() =>
{
	Wait.On("critical section", () =>
	{
		// Critical Section
		// Only one "critical section" will run at a time
	});
}).Start();
Wait.GetWaiter()
Waiter waiter = Wait.GetWaiter();

new Thread(() =>
{
	// Downloading
	waiter.Done();
}).Start();

waiter.WaitUntilDone();
// Download is done

wait

An obsessively simple and performant library for protecting critical sections.

NuGet

Let's look at some examples! Wait can be used using Wait.On() or Wait.GetWaiter().

Wait.On()
Wait.On("critical section", () =>
{
	// Critical Section
	// Only one "critical section" will run at a time
});

new Thread(() =>
{
	Wait.On("critical section", () =>
	{
		// Critical Section
		// Only one "critical section" will run at a time
	});
}).Start();
Wait.GetWaiter()
Waiter waiter = Wait.GetWaiter();

new Thread(() =>
{
	// Downloading
	waiter.Done();
}).Start();

waiter.WaitUntilDone();
// Download is done

Dependencies

This package has no dependencies.

Version History

Version Downloads Last updated
1.0.0 431 11/8/2017