void timerdel(Timer *dt) { Timers *tt; int64_t when; ilock(&dt->l); if(tt = dt->tt){ ilock(&tt->l); when = tdel(dt); if(when && tt == &timers[machp()->machno]) timerset(tt->head->twhen); iunlock(&tt->l); } iunlock(&dt->l); }
void timerdel(Timer *dt) { Timers *tt; uvlong when; ilock(dt); if(tt = dt->tt){ ilock(tt); when = tdel(dt); if(when && tt == &timers[m->machno]) timerset(tt->head->twhen); iunlock(tt); } iunlock(dt); }
void timerdel(Timer *dt) { Timers *tt; uvlong when; ilock(&dt->lk); if((tt = dt->tt)){ ilock(&tt->lk); when = tdel(dt); if(when && tt == &timers) kicktimerproc(); iunlock(&tt->lk); } iunlock(&dt->lk); }
/* add or modify a timer */ void timeradd(Timer *nt) { Timers *tt; int64_t when; /* Must lock Timer struct before Timers struct */ ilock(&nt->l); if(tt = nt->tt){ ilock(&tt->l); tdel(nt); iunlock(&tt->l); } tt = &timers[machp()->machno]; ilock(&tt->l); when = tadd(tt, nt); if(when) timerset(when); iunlock(&tt->l); iunlock(&nt->l); }
/* add or modify a timer */ void timeradd(Timer *nt) { Timers *tt; vlong when; /* Must lock Timer struct before Timers struct */ ilock(nt); if(tt = nt->tt){ ilock(tt); tdel(nt); iunlock(tt); } tt = &timers[m->machno]; ilock(tt); when = tadd(tt, nt); if(when) timerset(when); iunlock(tt); iunlock(nt); }
/* add or modify a timer */ void timeradd(Timer *nt) { Timers *tt; vlong when; /* Must lock Timer struct before Timers struct */ ilock(&nt->lk); if((tt = nt->tt)){ ilock(&tt->lk); tdel(nt); iunlock(&tt->lk); } tt = &timers; ilock(&tt->lk); when = tadd(tt, nt); if(when) kicktimerproc(); iunlock(&tt->lk); iunlock(&nt->lk); }