summaryrefslogtreecommitdiffstats
path: root/lib/libthr/thread/thr_mutex.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2016-04-08 10:21:43 +0000
committerkib <kib@FreeBSD.org>2016-04-08 10:21:43 +0000
commit21446f2890b124fd46c7f3b1244f0f24d80670b3 (patch)
treef9ffd2a1454f197b9f128f06e224492882967f53 /lib/libthr/thread/thr_mutex.c
parente099b3defecad889c8551888e1fb721a4dedab27 (diff)
downloadFreeBSD-src-21446f2890b124fd46c7f3b1244f0f24d80670b3.zip
FreeBSD-src-21446f2890b124fd46c7f3b1244f0f24d80670b3.tar.gz
Assert that the lock objects put into the off-page, fit into the page.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'lib/libthr/thread/thr_mutex.c')
-rw-r--r--lib/libthr/thread/thr_mutex.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/libthr/thread/thr_mutex.c b/lib/libthr/thread/thr_mutex.c
index 865e4cf..f732a63 100644
--- a/lib/libthr/thread/thr_mutex.c
+++ b/lib/libthr/thread/thr_mutex.c
@@ -51,6 +51,9 @@
#include "thr_private.h"
+_Static_assert(sizeof(struct pthread_mutex) <= PAGE_SIZE,
+ "pthread_mutex is too large for off-page");
+
/*
* For adaptive mutexes, how many times to spin doing trylock2
* before entering the kernel to block
OpenPOWER on IntegriCloud