Search This Blog

Friday, July 22, 2011

Try and finally block to unlock the locked object.

A locked object has be unlocked appropriately in order to avoid dead locks. This can be achieved by keeping the locking mechanism in the try block and unlocking mechanism in the finally block. No matter what happens in the try block finally block is always called so locking and unlocking happens appropriately. This is a safe practice to avoid deadlock.

Try and finally block to unlock the locked object.SocialTwist Tell-a-Friend