my solution to lab5

This commit is contained in:
winPond
2019-07-11 19:40:12 +08:00
parent 1f043fb694
commit f78713349c
364 changed files with 8775 additions and 3249 deletions

13
lab/lib/wait.c Normal file
View File

@@ -0,0 +1,13 @@
#include <inc/lib.h>
// Waits until 'envid' exits.
void
wait(envid_t envid)
{
const volatile struct Env *e;
assert(envid != 0);
e = &envs[ENVX(envid)];
while (e->env_id == envid && e->env_status != ENV_FREE)
sys_yield();
}