diff options
| author | 2013-04-10 13:17:41 +0000 | |
|---|---|---|
| committer | 2013-04-10 13:17:41 +0000 | |
| commit | 2623540dfe010634b5defe82bdfb6e908c546661 (patch) | |
| tree | 008187154deb7e8f007fc3f9b24460980fc7c805 /sys/compat/linux/linux_futex.c | |
| parent | futex: Sprinkle a few debug printfs that helped me in the past. (diff) | |
| download | wireguard-openbsd-2623540dfe010634b5defe82bdfb6e908c546661.tar.xz wireguard-openbsd-2623540dfe010634b5defe82bdfb6e908c546661.zip | |
futex: Prevent multiple futex pool initializations.
This is a temporary (ugly) fix, the pool init call should be moved from
linux_elf_probe into a better place.
Diffstat (limited to 'sys/compat/linux/linux_futex.c')
| -rw-r--r-- | sys/compat/linux/linux_futex.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 0ee34735b3e..31fabdadba4 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_futex.c,v 1.13 2013/04/10 13:11:24 pirofti Exp $ */ +/* $OpenBSD: linux_futex.c,v 1.14 2013/04/10 13:17:41 pirofti Exp $ */ /* $NetBSD: linux_futex.c,v 1.26 2010/07/07 01:30:35 chs Exp $ */ /*- @@ -69,6 +69,7 @@ struct pool futex_pool; struct pool futex_wp_pool; +int futex_pool_initialized; struct futex; @@ -411,10 +412,14 @@ void futex_pool_init(void) { DPRINTF(("Inside futex_pool_init()\n")); - pool_init(&futex_pool, sizeof(struct futex), 0, 0, PR_DEBUGCHK, - "futexpl", &pool_allocator_nointr); - pool_init(&futex_wp_pool, sizeof(struct waiting_proc), 0, 0, - PR_DEBUGCHK, "futexwppl", &pool_allocator_nointr); + + if (!futex_pool_initialized) { + pool_init(&futex_pool, sizeof(struct futex), 0, 0, PR_DEBUGCHK, + "futexpl", &pool_allocator_nointr); + pool_init(&futex_wp_pool, sizeof(struct waiting_proc), 0, 0, + PR_DEBUGCHK, "futexwppl", &pool_allocator_nointr); + futex_pool_initialized = 1; + } } /* |
