kernel: always reset notepending in eqlock, handle forceclosefgrp in eqlocks

This commit is contained in:
cinap_lenrek 2014-04-29 21:17:07 +02:00
parent b7d8431036
commit a2d96d47c9
4 changed files with 14 additions and 6 deletions

View file

@ -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

View file

@ -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);

View file

@ -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)
{

View file

@ -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;
}