diff --git a/lib/libthr/Makefile b/lib/libthr/Makefile --- a/lib/libthr/Makefile +++ b/lib/libthr/Makefile @@ -51,8 +51,10 @@ MAN= libthr.3 +.if ${MK_PTHREADS_INVARIANTS} != "no" # enable extra internal consistency checks CFLAGS+=-D_PTHREADS_INVARIANTS +.endif PRECIOUSLIB= diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c --- a/lib/libthr/thread/thr_mutex.c +++ b/lib/libthr/thread/thr_mutex.c @@ -120,7 +120,7 @@ __weak_reference(_pthread_mutex_isowned_np, pthread_mutex_isowned_np); static void -mutex_init_link(struct pthread_mutex *m) +mutex_init_link(struct pthread_mutex *m __unused) { #if defined(_PTHREADS_INVARIANTS) diff --git a/share/man/man5/src.conf.5 b/share/man/man5/src.conf.5 --- a/share/man/man5/src.conf.5 +++ b/share/man/man5/src.conf.5 @@ -1463,6 +1463,10 @@ .Xr gprof 8 . This option is deprecated and may not be present in a future version of .Fx . +.It Va WITHOUT_PTHREADS_INVARIANTS +Disable +.Xr pthread 3 +extra internal consistency checks. .It Va WITHOUT_QUOTAS Do not build .Xr quota 1 diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk --- a/share/mk/src.opts.mk +++ b/share/mk/src.opts.mk @@ -159,6 +159,7 @@ PKGBOOTSTRAP \ PMC \ PPP \ + PTHREADS_INVARIANTS \ QUOTAS \ RADIUS_SUPPORT \ RBOOTD \