[all-commits] [llvm/llvm-project] 2a14c0: [lldb] Make Broadcaster mutexes non-recursive (#97...

Pavel Labath via All-commits all-commits at lists.llvm.org
Wed Jul 3 01:29:38 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2a14c0643597c5932af85f22172c99800f9b4a6c
      https://github.com/llvm/llvm-project/commit/2a14c0643597c5932af85f22172c99800f9b4a6c
  Author: Pavel Labath <pavel at labath.sk>
  Date:   2024-07-03 (Wed, 03 Jul 2024)

  Changed paths:
    M lldb/include/lldb/Utility/Broadcaster.h
    M lldb/source/Utility/Broadcaster.cpp
    M lldb/source/Utility/Listener.cpp
    M lldb/unittests/Utility/ListenerTest.cpp

  Log Message:
  -----------
  [lldb] Make Broadcaster mutexes non-recursive (#97400)

Non-recursive mutexes encourage better locking discipline and avoid bugs
like #96750, where one can unexpectedly re-enter the critical section on
the same thread, and interrupt a presumed-indivisible operation.

In this case, the only needed fix was to remove locking from some
BroadcastManager functions, which were only called from the Listener
class (and the listener already locked those mutexes to preserve lock
ordering).

While doing that, I noticed we don't have unit tests for these
functions, so I added one.



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