make sure you do the unlocking in a try/finally block. This way the lock always gets unlocked.