Locks - reentrant,spin lock and non-reentrant lock