Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
julia_gc: fix detection of already canned root task
We already scan some stack during as part of the `GapRootScanner` callback, which usually will be the stack of the active task of the main thread. As an optimization, we want to avoid scanning that task's thread a second time in `GapTaskScanner`. We used to do that by checking in the latter whether the task about to be scanned is the current task. But that is wrong: the task may be different for all kinds of reasons, most notably if there are multiple GC threads active. So instead, just record the task we scanned in `GapRootScanner` (this is safe to write as there is single thread involved at this point) and then compare against that in `GapTaskScanner` (which may be called concurrently from multiple threads).
- Loading branch information