subr_sleepqueue.c (177375) | subr_sleepqueue.c (177471) |
---|---|
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 177375 2008-03-19 07:35:14Z jeff $"); | 63__FBSDID("$FreeBSD: head/sys/kern/subr_sleepqueue.c 177471 2008-03-21 08:23:25Z jeff $"); |
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> --- 314 unchanged lines hidden (view full) --- 386 mtx_assert(&sc->sc_lock, MA_OWNED); 387 MPASS(wchan != NULL); 388 /* 389 * See if there are any pending signals for this thread. If not 390 * we can switch immediately. Otherwise do the signal processing 391 * directly. 392 */ 393 thread_lock(td); | 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> --- 314 unchanged lines hidden (view full) --- 386 mtx_assert(&sc->sc_lock, MA_OWNED); 387 MPASS(wchan != NULL); 388 /* 389 * See if there are any pending signals for this thread. If not 390 * we can switch immediately. Otherwise do the signal processing 391 * directly. 392 */ 393 thread_lock(td); |
394 if ((td->td_flags & TDF_NEEDSIGCHK) == 0) { | 394 if ((td->td_flags & (TDF_NEEDSIGCHK | TDF_NEEDSUSPCHK)) == 0) { |
395 sleepq_switch(wchan, pri); 396 return (0); 397 } 398 thread_unlock(td); 399 mtx_unlock_spin(&sc->sc_lock); 400 CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", 401 (void *)td, (long)p->p_pid, td->td_name); 402 PROC_LOCK(p); --- 742 unchanged lines hidden --- | 395 sleepq_switch(wchan, pri); 396 return (0); 397 } 398 thread_unlock(td); 399 mtx_unlock_spin(&sc->sc_lock); 400 CTR3(KTR_PROC, "sleepq catching signals: thread %p (pid %ld, %s)", 401 (void *)td, (long)p->p_pid, td->td_name); 402 PROC_LOCK(p); --- 742 unchanged lines hidden --- |