Skip to content

Instantly share code, notes, and snippets.

@renestein
Last active August 29, 2015 14:02
Show Gist options
  • Save renestein/d589943e2e3357f40184 to your computer and use it in GitHub Desktop.
Save renestein/d589943e2e3357f40184 to your computer and use it in GitHub Desktop.
public virtual int Run()
{
checkIfDisposed();
return runTasks(withWorkCancelToken());
}
private CancellationToken withWorkCancelToken()
{
lock (m_workLockObject)
{
return (existsWork()
? m_workCancelTokenSource.Token
: withoutCancelToken());
}
}
private CancellationToken withoutCancelToken()
{
return CancellationToken.None;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment