Closed zonr closed 5 years ago
This is because AwaitResult
performs fast check on task.hasResult
without acquiring mutex. This is benign. And we recheck it with lock to make sure that the result is not ready and block the goroutine on cond. We have to find a way to disable the error.
We can use atomic.{Load,Store}Pointer
to access task.cond
in task.hasResult
to suppress the error but we decided to remove the quick path instead. We should show that there're non-negligible overheads before adding complexity
Commit: 1d896ab