sched: improve thread handling on system calls
This commit is contained in:
parent
89672d02f4
commit
72827c1e00
9 changed files with 157 additions and 180 deletions
|
|
@ -79,8 +79,12 @@ ssize_t serial_read(char *buf)
|
|||
|
||||
struct proc *proc = proc_find(getpid());
|
||||
|
||||
while((ret = ringbuf_read(tty0->data, &c, 1)) == 0) {
|
||||
kthread_yield();
|
||||
serial_trap();
|
||||
|
||||
while ((ret = ringbuf_read(tty0->data, &c, 1)) == 0) {
|
||||
_save_context();
|
||||
sti();
|
||||
yield();
|
||||
}
|
||||
|
||||
copy_to_user(proc, buf, &c, 1);
|
||||
|
|
|
|||
Loading…
Reference in a new issue