Skip to content

Instantly share code, notes, and snippets.

@whazor
Last active December 15, 2015 18:09
Show Gist options
  • Save whazor/fe520bc75f10b7ff2646 to your computer and use it in GitHub Desktop.
Save whazor/fe520bc75f10b7ff2646 to your computer and use it in GitHub Desktop.
class Blaat {
private readonly Waiter<Pion> _pionCompletion = new Waiter<Pion>();
private void PionKlik(Pion item)
{
_pionCompletion.Return(item);
}
public async Task<Pion> KiesPion(Func<Pion, bool> mogelijk)
{
while (true)
{
var pion = await _pionCompletion.Wait();
if (mogelijk(pion))
return pion;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment