[all-commits] [llvm/llvm-project] 1a5355: [ORC] Fix synchronization in CoreAPIsTest. (#144556)

Jameson Nash via All-commits all-commits at lists.llvm.org
Wed Jul 30 09:59:30 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 1a53553f11514c4eb116e6a935ada3e350d8d6c5
      https://github.com/llvm/llvm-project/commit/1a53553f11514c4eb116e6a935ada3e350d8d6c5
  Author: Jameson Nash <vtjnash at gmail.com>
  Date:   2025-07-30 (Wed, 30 Jul 2025)

  Changed paths:
    M llvm/unittests/ExecutionEngine/Orc/CoreAPIsTest.cpp

  Log Message:
  -----------
  [ORC] Fix synchronization in CoreAPIsTest. (#144556)

The code previously appeared to have a (benign?) race condition on
`WorkThreads.size`, since it was being accessed outside of the mutex
lock that protected it on the threads. This is usually okay since
1a1d6e6f98738be249b20994bcfed48dccac59e3, but doesn't seem reliable in
general, so fix this code to express the intent more accurately. This
instead relies on the same general principles as ref-counting, where
each existing reference (thread) can add new references (threads)
because they already have a reference themselves (until joined).



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list