Created
July 21, 2015 09:40
-
-
Save tomzorz/153a8c27e9a53717a25a to your computer and use it in GitHub Desktop.
it had to be done
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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