diff --git a/X10D/src/WaitHandleExtensions.cs b/X10D/src/WaitHandleExtensions.cs new file mode 100644 index 0000000..9febee6 --- /dev/null +++ b/X10D/src/WaitHandleExtensions.cs @@ -0,0 +1,21 @@ +namespace X10D +{ + using System.Threading; + using System.Threading.Tasks; + + /// + /// Extension methods for . + /// + public static class WaitHandleExtensions + { + /// + /// Returns a which can be awaited until the current receives a signal. + /// + /// The instance. + /// Returns a task which wraps . + public static Task WaitOneAsync(this WaitHandle handle) + { + return new Task(() => handle.WaitOne()); + } + } +}