lock has a simple syntax :
lock(referencetype variable)
{
block of statements ; // critical section
}
Example below :
lock (this)
{
balance = balance – amount;
}
lock has a simple syntax :
lock(referencetype variable)
{
block of statements ; // critical section
}
Example below :
lock (this)
{
balance = balance – amount;
}