コード例 #1
0
ファイル: portclock.c プロジェクト: Requaos/harvey
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);
}
コード例 #2
0
ファイル: portclock.c プロジェクト: Earnestly/plan9
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);
}
コード例 #3
0
ファイル: time.c プロジェクト: 0intro/vx32
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);
}
コード例 #4
0
ファイル: portclock.c プロジェクト: Requaos/harvey
/* 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);
}
コード例 #5
0
ファイル: portclock.c プロジェクト: Earnestly/plan9
/* 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);
}
コード例 #6
0
ファイル: time.c プロジェクト: 0intro/vx32
/* 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);
}