-
-
Save behnammohammadi/7b99a63cadc9511c58721b0cb77475e8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cancellationToken = new CancellationTokenSource(TimeSpan.FromSeconds(30)).Token; | |
lock (_lock) | |
{ | |
if (cancellationToken.IsCancellationRequested) | |
throw new TimeoutException(); | |
// critical section - crawling | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment