devip: increment in counter *AFTER* acquiering the ifc lock or loopbackmedium
This commit is contained in:
parent
dbf13129a7
commit
8962551055
2 changed files with 2 additions and 3 deletions
|
@ -75,14 +75,13 @@ loopbackread(void *a)
|
||||||
lb = ifc->arg;
|
lb = ifc->arg;
|
||||||
lb->readp = up; /* hide identity under a rock for unbind */
|
lb->readp = up; /* hide identity under a rock for unbind */
|
||||||
if(waserror()){
|
if(waserror()){
|
||||||
lb->readp = 0;
|
lb->readp = nil;
|
||||||
pexit("hangup", 1);
|
pexit("hangup", 1);
|
||||||
}
|
}
|
||||||
for(;;){
|
for(;;){
|
||||||
bp = qbread(lb->q, Maxtu);
|
bp = qbread(lb->q, Maxtu);
|
||||||
if(bp == nil)
|
if(bp == nil)
|
||||||
continue;
|
continue;
|
||||||
ifc->in++;
|
|
||||||
if(!canrlock(ifc)){
|
if(!canrlock(ifc)){
|
||||||
freeb(bp);
|
freeb(bp);
|
||||||
continue;
|
continue;
|
||||||
|
@ -91,6 +90,7 @@ loopbackread(void *a)
|
||||||
runlock(ifc);
|
runlock(ifc);
|
||||||
nexterror();
|
nexterror();
|
||||||
}
|
}
|
||||||
|
ifc->in++;
|
||||||
if(ifc->lifc == nil)
|
if(ifc->lifc == nil)
|
||||||
freeb(bp);
|
freeb(bp);
|
||||||
else
|
else
|
||||||
|
|
|
@ -117,7 +117,6 @@ netdevread(void *a)
|
||||||
/*
|
/*
|
||||||
* get here if mchan is a pipe and other side hangs up
|
* get here if mchan is a pipe and other side hangs up
|
||||||
* clean up this interface & get out
|
* clean up this interface & get out
|
||||||
ZZZ is this a good idea?
|
|
||||||
*/
|
*/
|
||||||
poperror();
|
poperror();
|
||||||
er->readp = nil;
|
er->readp = nil;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue