This is a small internal refactoring of the "new" Dispatcher.
Currently during cancellation there is a racy write/read of action (a plain var), and this is resolved by spinning on stateR (an AtomicReference). The idea of this PR is that since we already have an AtomicReference, which we're reading anyway, we can avoid the data race, and thus the spinning, by putting action inside the AtomicReference.
Besides this, there are 2 very small changes: removing an outdated comment, and an unnecessary type parameter.
This is a small internal refactoring of the "new"
Dispatcher
.Currently during cancellation there is a racy write/read of
action
(a plainvar
), and this is resolved by spinning onstateR
(anAtomicReference
). The idea of this PR is that since we already have anAtomicReference
, which we're reading anyway, we can avoid the data race, and thus the spinning, by puttingaction
inside theAtomicReference
.Besides this, there are 2 very small changes: removing an outdated comment, and an unnecessary type parameter.