The barrier task used by GCTaskManager::execute_and_wait() can still be running when
execute_and_wait() returns. If another GC occurs before the barrier task
finishes, WaitForBarrierGCTask can be overwritten for the new GC and can
cause unpredictable results.
There is a window during which a WaitForBarrierGCTask can be executing but
the storage for the WaitForBarrierGCTask has been deallocated. Avoid using the
task once into that window.