MCPcopy Create free account
hub / github.com/F-Stack/f-stack / thread_check_susp

Function thread_check_susp

freebsd/kern/kern_thread.c:1431–1453  ·  view source on GitHub ↗

* Check for possible stops and suspensions while executing a * casueword or similar transiently failing operation. * * The sleep argument controls whether the function can handle a stop * request itself or it should return ERESTART and the request is * proceed at the kernel/user boundary in ast. * * Typically, when retrying due to casueword(9) failure (rv == 1), we * should handle the stop

Source from the content-addressed store, hash-verified

1429 * handle it at all, and simply return EINTR.
1430 */
1431int
1432thread_check_susp(struct thread *td, bool sleep)
1433{
1434 struct proc *p;
1435 int error;
1436
1437 /*
1438 * The check for TDF_NEEDSUSPCHK is racy, but it is enough to
1439 * eventually break the lockstep loop.
1440 */
1441 if ((td->td_flags & TDF_NEEDSUSPCHK) == 0)
1442 return (0);
1443 error = 0;
1444 p = td->td_proc;
1445 PROC_LOCK(p);
1446 if (p->p_flag & P_SINGLE_EXIT)
1447 error = EINTR;
1448 else if (P_SHOULDSTOP(p) ||
1449 ((p->p_flag & P_TRACED) && (td->td_dbgflags & TDB_SUSPEND)))
1450 error = sleep ? thread_suspend_check(0) : ERESTART;
1451 PROC_UNLOCK(p);
1452 return (error);
1453}
1454
1455void
1456thread_suspend_switch(struct thread *td, struct proc *p)

Callers 15

vm_handle_rendezvousFunction · 0.85
vm_handle_hltFunction · 0.85
vm_handle_suspendFunction · 0.85
do_lock_normalFunction · 0.85
do_unlock_normalFunction · 0.85
do_wake_umutexFunction · 0.85
do_wake2_umutexFunction · 0.85
do_lock_piFunction · 0.85
do_unlock_piFunction · 0.85
do_lock_ppFunction · 0.85
do_rw_rdlockFunction · 0.85
do_rw_wrlockFunction · 0.85

Calls 1

thread_suspend_checkFunction · 0.85

Tested by

no test coverage detected