subr_sleepqueue.c (201879) | subr_sleepqueue.c (209612) |
---|---|
1/*- 2 * Copyright (c) 2004 John Baldwin <jhb@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 --- 46 unchanged lines hidden (view full) --- 55 * must consistently use the same lock to synchronize with a wait channel, 56 * though this check is currently only a warning for sleep/wakeup due to 57 * pre-existing abuse of that API. The same lock must also be held when 58 * awakening threads, though that is currently only enforced for condition 59 * variables. 60 */ 61 62#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2004 John Baldwin <jhb@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 --- 46 unchanged lines hidden (view full) --- 55 * must consistently use the same lock to synchronize with a wait channel, 56 * though this check is currently only a warning for sleep/wakeup due to 57 * pre-existing abuse of that API. The same lock must also be held when 58 * awakening threads, though that is currently only enforced for condition 59 * variables. 60 */ 61 62#include <sys/cdefs.h> |
63__FBSDID("$FreeBSD: head/sys/kern/subr_sleepqueue.c 201879 2010-01-09 01:46:38Z attilio $"); | 63__FBSDID("$FreeBSD: head/sys/kern/subr_sleepqueue.c 209612 2010-06-30 18:00:45Z jhb $"); |
64 65#include "opt_sleepqueue_profiling.h" 66#include "opt_ddb.h" 67#include "opt_sched.h" 68 69#include <sys/param.h> 70#include <sys/systm.h> 71#include <sys/lock.h> --- 365 unchanged lines hidden (view full) --- 437 ret = EINTR; 438 else 439 ret = ERESTART; 440 mtx_unlock(&ps->ps_mtx); 441 } 442 /* 443 * Lock the per-process spinlock prior to dropping the PROC_LOCK 444 * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and | 64 65#include "opt_sleepqueue_profiling.h" 66#include "opt_ddb.h" 67#include "opt_sched.h" 68 69#include <sys/param.h> 70#include <sys/systm.h> 71#include <sys/lock.h> --- 365 unchanged lines hidden (view full) --- 437 ret = EINTR; 438 else 439 ret = ERESTART; 440 mtx_unlock(&ps->ps_mtx); 441 } 442 /* 443 * Lock the per-process spinlock prior to dropping the PROC_LOCK 444 * to avoid a signal delivery race. PROC_LOCK, PROC_SLOCK, and |
445 * thread_lock() are currently held in tdsignal(). | 445 * thread_lock() are currently held in tdsendsignal(). |
446 */ 447 PROC_SLOCK(p); 448 mtx_lock_spin(&sc->sc_lock); 449 PROC_UNLOCK(p); 450 thread_lock(td); 451 PROC_SUNLOCK(p); 452 if (ret == 0) { 453 sleepq_switch(wchan, pri); --- 774 unchanged lines hidden --- | 446 */ 447 PROC_SLOCK(p); 448 mtx_lock_spin(&sc->sc_lock); 449 PROC_UNLOCK(p); 450 thread_lock(td); 451 PROC_SUNLOCK(p); 452 if (ret == 0) { 453 sleepq_switch(wchan, pri); --- 774 unchanged lines hidden --- |