add function to block and to unblock a task - add minor modifications to support the latest nightly compiler