kern_event.c (141616) | kern_event.c (142217) |
---|---|
1/*- 2 * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> 3 * Copyright 2004 John-Mark Gurney <jmg@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1999,2000,2001 Jonathan Lemon <jlemon@FreeBSD.org> 3 * Copyright 2004 John-Mark Gurney <jmg@FreeBSD.org> 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 12 unchanged lines hidden (view full) --- 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/kern/kern_event.c 141616 2005-02-10 12:02:37Z phk $"); | 29__FBSDID("$FreeBSD: head/sys/kern/kern_event.c 142217 2005-02-22 13:11:33Z rwatson $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/proc.h> 37#include <sys/malloc.h> --- 402 unchanged lines hidden (view full) --- 440 atomic_add_int(&kq_ncallouts, -1); 441 return (ENOMEM); 442 } 443 444 kn->kn_flags |= EV_CLEAR; /* automatically set */ 445 kn->kn_status &= ~KN_DETACHED; /* knlist_add usually sets it */ 446 MALLOC(calloutp, struct callout *, sizeof(*calloutp), 447 M_KQUEUE, M_WAITOK); | 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/kernel.h> 34#include <sys/lock.h> 35#include <sys/mutex.h> 36#include <sys/proc.h> 37#include <sys/malloc.h> --- 402 unchanged lines hidden (view full) --- 440 atomic_add_int(&kq_ncallouts, -1); 441 return (ENOMEM); 442 } 443 444 kn->kn_flags |= EV_CLEAR; /* automatically set */ 445 kn->kn_status &= ~KN_DETACHED; /* knlist_add usually sets it */ 446 MALLOC(calloutp, struct callout *, sizeof(*calloutp), 447 M_KQUEUE, M_WAITOK); |
448 callout_init(calloutp, 1); | 448 callout_init(calloutp, CALLOUT_MPSAFE); |
449 kn->kn_hook = calloutp; 450 callout_reset(calloutp, timertoticks(kn->kn_sdata), filt_timerexpire, 451 kn); 452 453 return (0); 454} 455 456/* XXX - move to kern_timeout.c? */ --- 1341 unchanged lines hidden --- | 449 kn->kn_hook = calloutp; 450 callout_reset(calloutp, timertoticks(kn->kn_sdata), filt_timerexpire, 451 kn); 452 453 return (0); 454} 455 456/* XXX - move to kern_timeout.c? */ --- 1341 unchanged lines hidden --- |