Return in a lock statement C# with Example
Following code will release lock. lock(locker) { return 5; } For a detailed explanation, this SO answer is recommended.