getNextCommand() is done, locks and signals have been added