lock keyword in C#

前端 未结 10 907
南旧
南旧 2020-11-30 03:54

I understand the main function of the lock key word from MSDN

lock Statement (C# Reference)

The lock keyword marks a statement block as

10条回答
  •  孤城傲影
    2020-11-30 04:16

    There is no point in having locks in the app if there is only one thread and yes, it is a performance hit although it does take a fair number of calls for that hit to stack up into something significant.

提交回复
热议问题