lock keyword in C#

前端 未结 10 909
南旧
南旧 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:09

    Bear in mind that there might be reasons why your application is not as single-threaded as you think. Async I/O in .NET may well call-back on a pool thread, for example, as do some of the various timer classes (not the Windows Forms Timer, though).

提交回复
热议问题