Queue lock/unlock and time helper method