Deleted Added
full compact
subr_taskqueue.c (221059) subr_taskqueue.c (225570)
1/*-
2 * Copyright (c) 2000 Doug Rabson
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

--- 11 unchanged lines hidden (view full) ---

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
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Doug Rabson
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

--- 11 unchanged lines hidden (view full) ---

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
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/kern/subr_taskqueue.c 221059 2011-04-26 11:39:56Z kib $");
28__FBSDID("$FreeBSD: head/sys/kern/subr_taskqueue.c 225570 2011-09-15 08:42:06Z adrian $");
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/interrupt.h>
34#include <sys/kernel.h>
35#include <sys/kthread.h>
29
30#include <sys/param.h>
31#include <sys/systm.h>
32#include <sys/bus.h>
33#include <sys/interrupt.h>
34#include <sys/kernel.h>
35#include <sys/kthread.h>
36#include <sys/limits.h>
36#include <sys/lock.h>
37#include <sys/malloc.h>
38#include <sys/mutex.h>
39#include <sys/proc.h>
40#include <sys/sched.h>
41#include <sys/taskqueue.h>
42#include <sys/unistd.h>
43#include <machine/stdarg.h>

--- 124 unchanged lines hidden (view full) ---

168{
169 struct task *ins;
170 struct task *prev;
171
172 /*
173 * Count multiple enqueues.
174 */
175 if (task->ta_pending) {
37#include <sys/lock.h>
38#include <sys/malloc.h>
39#include <sys/mutex.h>
40#include <sys/proc.h>
41#include <sys/sched.h>
42#include <sys/taskqueue.h>
43#include <sys/unistd.h>
44#include <machine/stdarg.h>

--- 124 unchanged lines hidden (view full) ---

169{
170 struct task *ins;
171 struct task *prev;
172
173 /*
174 * Count multiple enqueues.
175 */
176 if (task->ta_pending) {
176 task->ta_pending++;
177 if (task->ta_pending < USHRT_MAX)
178 task->ta_pending++;
177 return (0);
178 }
179
180 /*
181 * Optimise the case when all tasks have the same priority.
182 */
183 prev = STAILQ_LAST(&queue->tq_queue, task, ta_link);
184 if (!prev || prev->ta_priority >= task->ta_priority) {

--- 403 unchanged lines hidden ---
179 return (0);
180 }
181
182 /*
183 * Optimise the case when all tasks have the same priority.
184 */
185 prev = STAILQ_LAST(&queue->tq_queue, task, ta_link);
186 if (!prev || prev->ta_priority >= task->ta_priority) {

--- 403 unchanged lines hidden ---