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

Function kern_ktimer_delete

freebsd/kern/kern_time.c:1322–1352  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1320}
1321
1322int
1323kern_ktimer_delete(struct thread *td, int timerid)
1324{
1325 struct proc *p = td->td_proc;
1326 struct itimer *it;
1327
1328 PROC_LOCK(p);
1329 it = itimer_find(p, timerid);
1330 if (it == NULL) {
1331 PROC_UNLOCK(p);
1332 return (EINVAL);
1333 }
1334 PROC_UNLOCK(p);
1335
1336 it->it_flags |= ITF_DELETING;
1337 while (it->it_usecount > 0) {
1338 it->it_flags |= ITF_WANTED;
1339 msleep(it, &it->it_mtx, PPAUSE, "itimer", 0);
1340 }
1341 it->it_flags &= ~ITF_WANTED;
1342 CLOCK_CALL(it->it_clockid, timer_delete, (it));
1343 ITIMER_UNLOCK(it);
1344
1345 PROC_LOCK(p);
1346 if (KSI_ONQ(&it->it_ksi))
1347 sigqueue_take(&it->it_ksi);
1348 p->p_itimers->its_timers[timerid] = NULL;
1349 PROC_UNLOCK(p);
1350 uma_zfree(itimer_zone, it);
1351 return (0);
1352}
1353
1354#ifndef _SYS_SYSPROTO_H_
1355struct ktimer_settime_args {

Callers 3

sys_ktimer_createFunction · 0.85
sys_ktimer_deleteFunction · 0.85
itimers_event_exit_execFunction · 0.85

Calls 3

itimer_findFunction · 0.85
sigqueue_takeFunction · 0.85
uma_zfreeFunction · 0.50

Tested by

no test coverage detected