julia
ba139334 - Rename some JL_HAVE_* constants to `JL_TASK_SWITCH_*` for clarity, and some related cleanup (#54911)

Commit
43 days ago
Rename some JL_HAVE_* constants to `JL_TASK_SWITCH_*` for clarity, and some related cleanup (#54911) - **Replace JL_HAVE_UCONTEXT by JL_TASK_SWITCH_WINDOWS** - **Untangle OpenBSD checks in julia_threads.h** - **Rename JL_HAVE_UNW_CONTEXT -> JL_TASK_SWITCH_LIBUNWIND** - **Rename JL_HAVE_ASM -> JL_TASK_SWITCH_ASM** Whenever I try to understand the task switch code, I have to figure out again when which of the various `JL_HAVE_*` constants are set, how they interact, etc. -- and indeed recall that `JL_HAVE_*` controls the task switching code in the first place. So it seems sensible to me to rename these to indicate they control task switching. This is in particular true for `JL_HAVE_UCONTEXT` which was/is exclusively used on on Windows, despite the reference to `ucontext`, a POSIX feature (albeit one removed from the standard in POSIX.1-2008). Of course it is still conceivable that in the future someone wants to port Julia to a new platform and for some reason libunwind switching is not workable, but the `ucontext` one is -- in that case it wouldn't be too hard to add back a `JL_TASK_SWITCH_UCONTEXT`. But IMHO such a hypothetical future is a good reason to confuse people trying to understand the code today.
Author
Parents
Loading