On Fri, Sep 11, 2020 at 04:07:24PM +0200, Kamil Rytarowski wrote: > The current code is confusing, as it attempts to use unimplemented > _PTHREAD_GETTCB_EXT() and in one place uses _lwp_getprivate_fast() in > other _lwp_getprivate(). This caused my confusion... as I assumed that > _lwp_getprivate_fast() is internal and _lwp_getprivate() for public > consumption.
_PTHREAD_GETTCB_EXT is a rump hack. There is no _lwp_getprivate_fast. There is __lwp_getprivate_fast, which originally wasn't implemented on architectures without a fast path (like VAX). Nowadays, all functional ports provide either __lwp_getprivate_fast (potentially with a fall-back to the system call) or __lwp_gettcb_fast. The difference is whether the TLS register is biased or not. Joerg