Skip to content

Instantly share code, notes, and snippets.

@tomzorz
Created July 21, 2015 09:40
Show Gist options
  • Save tomzorz/153a8c27e9a53717a25a to your computer and use it in GitHub Desktop.
Save tomzorz/153a8c27e9a53717a25a to your computer and use it in GitHub Desktop.
it had to be done
// do this
namespace Helpers
{
public static class Helper
{
public static async Task PleaseStandUpAsync(this SemaphoreSlim s)
{
await s.WaitAsync();
}
public static void SitDown(this SemaphoreSlim s)
{
s.Release();
}
}
}
// so you can do this
var realSlimShady = new SemaphoreSlim(1);
await realSlimShady.PleaseStandUpAsync();
realSlimShady.SitDown();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment