C# Language Return in a lock statement


Example

Following code will release lock.

lock(locker)
{
    return 5;
}

For a detailed explanation, this SO answer is recommended.