Changeset View
Changeset View
Standalone View
Standalone View
head/sys/kern/kern_umtx.c
Show First 20 Lines • Show All 717 Lines • ▼ Show 20 Lines | umtxq_check_susp(struct thread *td, bool sleep) | ||||
* The check for TDF_NEEDSUSPCHK is racy, but it is enough to | * The check for TDF_NEEDSUSPCHK is racy, but it is enough to | ||||
* eventually break the lockstep loop. | * eventually break the lockstep loop. | ||||
*/ | */ | ||||
if ((td->td_flags & TDF_NEEDSUSPCHK) == 0) | if ((td->td_flags & TDF_NEEDSUSPCHK) == 0) | ||||
return (0); | return (0); | ||||
error = 0; | error = 0; | ||||
p = td->td_proc; | p = td->td_proc; | ||||
PROC_LOCK(p); | PROC_LOCK(p); | ||||
if (P_SHOULDSTOP(p) || | |||||
((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) { | |||||
if (p->p_flag & P_SINGLE_EXIT) | if (p->p_flag & P_SINGLE_EXIT) | ||||
error = EINTR; | error = EINTR; | ||||
else | else if (P_SHOULDSTOP(p) || | ||||
((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND))) | |||||
error = sleep ? thread_suspend_check(0) : ERESTART; | error = sleep ? thread_suspend_check(0) : ERESTART; | ||||
} | |||||
PROC_UNLOCK(p); | PROC_UNLOCK(p); | ||||
return (error); | return (error); | ||||
} | } | ||||
/* | /* | ||||
* Wake up threads waiting on an userland object. | * Wake up threads waiting on an userland object. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 3,974 Lines • Show Last 20 Lines |