mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-10-28 11:25:21 +01:00
To get at userspace threads, we use a mix of -pthread and -lpthread to compiler and/or linker. That's fine enough for the platforms we target but its not exactly right (eg on Linux -pthread defines _REENTRANT, when -lpthread does not), and won't work properly some other platforms that we might end up on someday (eg illumos). There's also a danger if we link together two compilations units, one compiled with -pthread, one not, as calls between them may not properly manage thread state. Here we switch to use the AX_PTHREAD macro to detect the correct set of flags for CFLAGS and LIBS, and add them to the default compilation flags for all units. Sponsored-by: TrueNAS Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Rob Norris <[email protected]> Closes #18588