syscall: adjust kernel blocking mechanism
Allow for a seamless escalation of privilege that maintains the same thread of execution during a syscall, allowing syscalls to more easily block and unblock
This commit is contained in:
parent
e7133a473f
commit
210663fe0f
5 changed files with 36 additions and 33 deletions
|
|
@ -166,6 +166,9 @@ void schedule()
|
|||
|
||||
break;
|
||||
case PROC_BLOCKED:
|
||||
if (!sem_trywait(&proc->block_sem))
|
||||
proc_unblock(proc->pid);
|
||||
spinlock_release(&proc->lock);
|
||||
case PROC_RUNNING:
|
||||
spinlock_release(&proc->lock);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Reference in a new issue