subr_eventhandler.c (69893) | subr_eventhandler.c (71228) |
---|---|
1/*- 2 * Copyright (c) 1999 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1999 Michael Smith <msmith@freebsd.org> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $FreeBSD: head/sys/kern/subr_eventhandler.c 69893 2000-12-12 04:01:35Z jhb $ | 26 * $FreeBSD: head/sys/kern/subr_eventhandler.c 71228 2001-01-19 01:59:14Z bmilekic $ |
27 */ 28 29#include <sys/param.h> 30#include <sys/kernel.h> 31#include <sys/malloc.h> 32#include <sys/mutex.h> 33#include <sys/systm.h> 34#include <sys/eventhandler.h> --- 13 unchanged lines hidden (view full) --- 48 49/* 50 * Initialize the eventhandler mutex and list. 51 */ 52static void 53eventhandler_init(void *dummy __unused) 54{ 55 TAILQ_INIT(&eventhandler_lists); | 27 */ 28 29#include <sys/param.h> 30#include <sys/kernel.h> 31#include <sys/malloc.h> 32#include <sys/mutex.h> 33#include <sys/systm.h> 34#include <sys/eventhandler.h> --- 13 unchanged lines hidden (view full) --- 48 49/* 50 * Initialize the eventhandler mutex and list. 51 */ 52static void 53eventhandler_init(void *dummy __unused) 54{ 55 TAILQ_INIT(&eventhandler_lists); |
56 mtx_init(&eventhandler_mutex, "eventhandler", MTX_DEF); | 56 mtx_init(&eventhandler_mutex, "eventhandler", MTX_DEF | MTX_RECURSE); |
57 eventhandler_lists_initted = 1; 58} 59SYSINIT(eventhandlers, SI_SUB_EVENTHANDLER, SI_ORDER_FIRST, eventhandler_init, 60 NULL) 61 62/* 63 * Insertion is O(n) due to the priority scan, but optimises to O(1) 64 * if all priorities are identical. --- 104 unchanged lines hidden --- | 57 eventhandler_lists_initted = 1; 58} 59SYSINIT(eventhandlers, SI_SUB_EVENTHANDLER, SI_ORDER_FIRST, eventhandler_init, 60 NULL) 61 62/* 63 * Insertion is O(n) due to the priority scan, but optimises to O(1) 64 * if all priorities are identical. --- 104 unchanged lines hidden --- |