You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[lldb][NFC] Break ThreadMemory into smaller abstractions
ThreadMemory attempts to be a class abstracting the notion of a "fake"
Thread that is backed by a "real" thread. According to its
documentation, it is meant to be a class forwarding most methods to the
backing thread, but it does so only for a handful of methods.
Along the way, it also tries to represent a Thread that may or may not
have a different name, and may or may not have a different queue from
the backing thread. This can be problematic for a couple of reasons:
1. It forces all users into this optional behavior.
2. The forwarding behavior is incomplete: not all methods are currently
being forwarded properly. Some of them involve queues and seem to
have been intentionally left unimplemented.
This commit creates the following separation:
ThreadMemory <- NamedThreadMemory <- NamedThreadMemoryWithQueue
ThreadMemory captures the notion of a backed thread that _really_
forwards all methods to the backing thread. (Missing methods should be
implemented in a later commit, and allowing them to be implemented
without changing behavior of other derived classes is the main purpose
of this refactor).
NamedThreadMemory is a ThreadMemory that allows users to override the
thread name. If a name is present, it is used; otherwise the forwarding
behavior is used.
NamedThreadMemoryWithQueue is a NamedThreadMemory that allows users to
override queue information. If queue information is present, it is used;
otherwise, the forwarding behavior is used.
With this separation, we can more explicitly implement missing methods
of the base class and override them, if needed, in
ThreadMemoryWithQueue. But this commit really is NFC, no new methods are
implemented and no method implementation is changed.
0 commit comments