kernel: always reset notepending in eqlock, handle forceclosefgrp in eqlocks
This commit is contained in:
parent
b7d8431036
commit
a2d96d47c9
4 changed files with 14 additions and 6 deletions
|
@ -225,7 +225,7 @@ closefgrp(Fgrp *f)
|
|||
}
|
||||
|
||||
/*
|
||||
* Called from sleep because up is in the middle
|
||||
* Called from interrupted() because up is in the middle
|
||||
* of closefgrp and just got a kill ctl message.
|
||||
* This usually means that up has wedged because
|
||||
* of some kind of deadly embrace with mntclose
|
||||
|
|
|
@ -130,6 +130,7 @@ Block* iallocb(int);
|
|||
void iallocsummary(void);
|
||||
long ibrk(uintptr, int);
|
||||
void ilock(Lock*);
|
||||
void interrupted(void);
|
||||
void iunlock(Lock*);
|
||||
long incref(Ref*);
|
||||
void initseg(void);
|
||||
|
|
|
@ -802,14 +802,20 @@ sleep(Rendez *r, int (*f)(void*), void *arg)
|
|||
if(up->notepending) {
|
||||
up->notepending = 0;
|
||||
splx(s);
|
||||
if(up->procctl == Proc_exitme && up->closingfgrp)
|
||||
forceclosefgrp();
|
||||
error(Eintr);
|
||||
interrupted();
|
||||
}
|
||||
|
||||
splx(s);
|
||||
}
|
||||
|
||||
void
|
||||
interrupted(void)
|
||||
{
|
||||
if(up->procctl == Proc_exitme && up->closingfgrp != nil)
|
||||
forceclosefgrp();
|
||||
error(Eintr);
|
||||
}
|
||||
|
||||
static int
|
||||
tfn(void *arg)
|
||||
{
|
||||
|
|
|
@ -39,8 +39,9 @@ eqlock(QLock *q)
|
|||
if(up == 0)
|
||||
panic("eqlock");
|
||||
if(up->notepending){
|
||||
up->notepending = 0;
|
||||
unlock(&q->use);
|
||||
error(Eintr);
|
||||
interrupted();
|
||||
}
|
||||
rwstats.qlockq++;
|
||||
p = q->tail;
|
||||
|
@ -57,7 +58,7 @@ eqlock(QLock *q)
|
|||
sched();
|
||||
if(up->eql == 0){
|
||||
up->notepending = 0;
|
||||
error(Eintr);
|
||||
interrupted();
|
||||
}
|
||||
up->eql = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue