jos/lib/wait.c

14 lines
231 B
C
Raw Permalink Normal View History

2018-10-24 17:44:45 -07:00
#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();
}