ticket.36960: Modify logic of unlock in EventQueue