This docs mix tasks with threads. A task is not a thread ! 2 different tasks can run in the same thread. It's the TaskScheduler job to determines which Task runs on which thread. Thus this documentation is very confusing. SemaphoreSlim does not lock access to a thread. It locks access to a resource. Which can be of any kind!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
ID: e1be1dd3-b825-9f35-eafb-8904eca9f9d7
Version Independent ID: 92f24f67-5b11-f1d1-a8cc-b8bf8fbe7ddc
Thanks for your feedback, @softlion. It appears that we retrofitted a threading example to use tasks and did it incompletely. We'll update the example during an upcoming sprint.
This docs mix tasks with threads. A task is not a thread ! 2 different tasks can run in the same thread. It's the TaskScheduler job to determines which Task runs on which thread. Thus this documentation is very confusing. SemaphoreSlim does not lock access to a thread. It locks access to a resource. Which can be of any kind!
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.