NPL used to be peppered with casts of the NativeThreadProtocol objects into NativeThreadLinux. I
move these closer to the source where we obtain these objects. This way, the rest of the code can
assume we are working with the correct type of objects.
Details
Diff Detail
Event Timeline
Looks good.
One inconsistency what might worth a change is that you usually pass NPL as a shared_ptr (or a reference to a shared_ptr) but you created a few function where it isn't true (e.g. ThreadWasCreated). I would prefer to always pass it by shared_ptr (possibly as a reference) for consistency.
LGTM
source/Plugins/Process/Linux/NativeProcessLinux.cpp | ||
---|---|---|
2834 | You may use std::make_shared |
Passing around pointers (shared or otherwise) encourages people to litter the code with null pointer checks. For the next cleanup, I would like to move these checks to a single place and then convert more of these functions to take references.
Thanks for the info about the plans. If you plan to move to this direction then it make sense to leave these functions with reference arguments.
Side note: Why we use a shared_ptr for NTL? I would expect a unique_ptr would be sufficient in NPL (or possibly a store by value with move constructors).
You may use std::make_shared