[all-commits] [llvm/llvm-project] c78e65: [lldb][plugin] Use counter directly for number of ...

Jacques Pienaar via All-commits all-commits at lists.llvm.org
Tue May 13 01:52:59 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c78e65cc980db9542b32049a5d96b00c64cbc47d
      https://github.com/llvm/llvm-project/commit/c78e65cc980db9542b32049a5d96b00c64cbc47d
  Author: Jacques Pienaar <jpienaar at google.com>
  Date:   2025-05-13 (Tue, 13 May 2025)

  Changed paths:
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
    M lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
    M lldb/test/API/tools/lldb-dap/console/TestDAP_console.py

  Log Message:
  -----------
  [lldb][plugin] Use counter directly for number of readers (#139252)

Here we were initializing & locking a shared_mutex in a thread, while
releasing it in the parent which may/often turned out to be a different
thread (shared_mutex::unlock_shared is undefined behavior if called from
a thread that doesn't hold the lock).

Switch to counter to more simply keep track of number of readers and
simply lock/unlock rather than utilizing reader mutex to verify last
freed (and so requiring this matching thread init/destroy behavior).



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