[Lldb-commits] [PATCH] D131160: [WIP][lldb] Add "event" capability to the MainLoop class

Pavel Labath via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Fri Aug 19 06:38:42 PDT 2022


labath added a comment.

In D131160#3735024 <https://reviews.llvm.org/D131160#3735024>, @mgorny wrote:

> Ok, so I'm going to give it a shot today. Could you clarify one thing though?
>
>> All it would take is to add some locking around the PendingCallback manipulations
>
> Are you thinking of locking directly in `MainLoop` classes, or in the caller? It'd feel a bit inconsistent if `MainLoop`s provided locking around pending callback manipulations and not other methods. However, I suppose making everything thread-safe wouldn't hurt either.

I'm not sure this can be done from the outside, as the callback adittions need to synchronize with the accesses that happen inside the Run function. It is somewhat inconsistent, but for example python has special `call_soon`/`call_soon_threadsafe`  versions for code which needs to schedule callbacks from other threads. We could do something like that. Or we could also just lock everything...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D131160/new/

https://reviews.llvm.org/D131160



More information about the lldb-commits mailing list