Semaphore Wait vs WaitAsync in an async method

前端 未结 2 1362
情话喂你
情话喂你 2021-02-07 15:52

I\'m trying to find out what is the difference between the SemaphoreSlim use of Wait and WaitAsync, used in this kind of context:

private SemaphoreSlim semaphore         


        
2条回答
  •  梦谈多话
    2021-02-07 16:10

    The difference is that Wait blocks the current thread until semaphore is released, while WaitAsync does not.

提交回复
热议问题