Files
freebsd/lib/libspl
Rob Norris 6c08f5db51 config: detect the right way to get pthreads
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
2026-05-26 12:49:53 -07:00
..
2025-03-13 17:56:27 -07:00
2025-03-13 17:56:27 -07:00
2025-04-24 13:58:48 -04:00
2025-03-13 17:56:27 -07:00
2025-11-12 10:04:22 -08:00
2025-03-13 17:56:27 -07:00
2025-03-13 17:56:27 -07:00
2025-03-13 17:56:27 -07:00
2025-03-13 17:56:27 -07:00
2025-03-13 17:56:27 -07:00
2025-11-12 10:04:22 -08:00
2025-03-13 17:56:27 -07:00