#32 Added a lock to getTask()