consolewrite does not need cons.lock -- can lead to sleep() with lock held

This commit is contained in:
Robert Morris 2020-10-20 06:55:51 -04:00
parent 806580d642
commit 286b2f3c33

View file

@ -60,14 +60,12 @@ consolewrite(int user_src, uint64 src, int n)
{
int i;
acquire(&cons.lock);
for(i = 0; i < n; i++){
char c;
if(either_copyin(&c, user_src, src+i, 1) == -1)
break;
uartputc(c);
}
release(&cons.lock);
return i;
}