Skip to content

Instantly share code, notes, and snippets.

View bravequickcleverfibreyarn's full-sized avatar
🤢
Ought to nought not.

boldswiftsmartfiberhank bravequickcleverfibreyarn

🤢
Ought to nought not.
View GitHub Profile
@AArnott
AArnott / WaitHandlerAwaitable.cs
Created July 15, 2011 15:55
C# 5 Awaitable WaitHandle
public static class AwaitExtensions
{
/// <summary>
/// Provides await functionality for ordinary <see cref="WaitHandle"/>s.
/// </summary>
/// <param name="handle">The handle to wait on.</param>
/// <returns>The awaiter.</returns>
public static TaskAwaiter GetAwaiter(this WaitHandle handle)
{
Contract.Requires<ArgumentNullException>(handle != null);