Skip to content

Instantly share code, notes, and snippets.

@hidori
Last active October 4, 2015 14:08
Show Gist options
  • Save hidori/2651034 to your computer and use it in GitHub Desktop.
Save hidori/2651034 to your computer and use it in GitHub Desktop.
Waiting asyncronous works completion simpley
static class Syncronized
{
public static void Invoke(Action<ManualResetEvent> action)
{
if (action == null) throw new ArgumentException("action");
using (var signal = new ManualResetEvent(false))
{
action(signal);
signal.WaitOne();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment