12
No, the lock will be released, lock is roughly equivalent to this:
try
{
Monitor.Enter(programLock);
// some stuff 1
}
finally
{
Monitor.Exit(programLock);
}
(Meaning if an exception is thrown, Monitor.Exit will get called automatically as you exit the scope of the lock statement)