Lock before unlock