From 21446f2890b124fd46c7f3b1244f0f24d80670b3 Mon Sep 17 00:00:00 2001 From: kib Date: Fri, 8 Apr 2016 10:21:43 +0000 Subject: Assert that the lock objects put into the off-page, fit into the page. Sponsored by: The FreeBSD Foundation --- lib/libthr/thread/thr_mutex.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/libthr/thread/thr_mutex.c') 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 -- cgit v1.1