jos/lib/wait.c
Anish Athalye c67463e23c Lab 5
2018-10-24 20:44:45 -04:00

14 lines
231 B
C

#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();
}