Skip to main content

Home/ .Net Developers/ Group items tagged keyword

Rss Feed Group items tagged

Tarik Guney

lock Statement (C# Reference) - 0 views

  • The lock keyword marks a statement block as a critical section by obtaining the mutual-exclusion lock for a given object, executing a statement, and then releasing the lock
  • The expression reference type in lock(expression) should not be null.
  •  
    The lock keyword ensures that one thread does not enter a critical section of code while another thread is in the critical section. If another thread tries to enter a locked code, it will wait, block, until the object is released. The section Threading (C# Programming Guide) discusses threading. The lock keyword calls Enter at the start of the block and Exit at the end of the block.
Tarik Guney

Using the default keyword in C# - 0 views

  •  
    Different use of 'default' keyword in C#. It is also used for distinguishing whether a type is value type or reference type and also getting the default value of a variable by its type.
1 - 2 of 2
Showing 20 items per page