Created
September 28, 2018 13:26
-
-
Save Criteo-dotnet-blog/5dbf6e6880778e5a966d4df090937a2a 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
_workers = new Task[workerCount]; | |
for (int i = 0; i < workerCount; i++) | |
{ | |
_workers[i] = Task.Run(async () => | |
{ | |
while (true) | |
{ | |
lock (_lock) | |
{ | |
Thread.Sleep(5); | |
} | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment