In the context of this pull request, what does thread-safe mean? You definitely have a race condition, but I don't see any correctness issues. In the worst case you'd get a false cache-miss. Not sure it would be worth synchronizing here.

Of course, @paulp is right that thread-safety in general. Is there a plan to this end/