This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix threading bugs in (not-yet-used) BackgroundIndex, re-enable test.
ClosedPublic

Authored by sammccall on Oct 16 2018, 1:51 AM.

Details

Summary

One relatively boring bug: forgot to notify the CV after enqueue.

One much more fun bug: the thread member could access instance variables before
they were initialized. Although the thread was last in the init list, QueueCV
etc were listed after Thread in the class, so their default constructors raced
with the thread itself.
We have to get very unlucky to lose this race, I saw it 0.02% of the time.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Oct 16 2018, 1:51 AM
ioeric accepted this revision.Oct 16 2018, 2:02 AM
This revision is now accepted and ready to land.Oct 16 2018, 2:02 AM
This revision was automatically updated to reflect the committed changes.