| 1320 | } |
| 1321 | |
| 1322 | int |
| 1323 | kern_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_ |
| 1355 | struct ktimer_settime_args { |
no test coverage detected