consolewrite does not need cons.lock -- can lead to sleep() with lock held
This commit is contained in:
parent
d4cecb269f
commit
13dccb0380
|
@ -60,14 +60,12 @@ consolewrite(int user_src, uint64 src, int n)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
acquire(&cons.lock);
|
|
||||||
for(i = 0; i < n; i++){
|
for(i = 0; i < n; i++){
|
||||||
char c;
|
char c;
|
||||||
if(either_copyin(&c, user_src, src+i, 1) == -1)
|
if(either_copyin(&c, user_src, src+i, 1) == -1)
|
||||||
break;
|
break;
|
||||||
uartputc(c);
|
uartputc(c);
|
||||||
}
|
}
|
||||||
release(&cons.lock);
|
|
||||||
|
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue