[Lldb-commits] [PATCH] D117601: [lldb] Make Python initialization atomic
Jonas Devlieghere via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Tue Jan 18 23:38:24 PST 2022
JDevlieghere planned changes to this revision.
JDevlieghere added a comment.
In D117601#3253663 <https://reviews.llvm.org/D117601#3253663>, @labath wrote:
> I don't think that `atomic<bool>` is what you want here. In the case of a race, the "loser" will immediately continue to use python as if it was initialized, even though the winner has not finished the initialization. You most likely need `call_once` semantics, blocking all threads until the initialization completes.
>
> That said, I think think it would be better to do this initialization in the `Initialize` static function. Out of general cleanliness, but with a particular with a view towards the SIGINT patch. That way the initialization functions happens in a predictable and single-threaded context (as you can see, threads are hard), hopefully at a point where nobody will care that we're mucking with the SIGINT handlers.
Makes sense. I’ll update the patch tomorrow.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D117601/new/
https://reviews.llvm.org/D117601
More information about the lldb-commits
mailing list