ast_comparator/test/student_data/handout/shlab-handout/cases/prev_8_tsh.c
/*
 * waitfg - Block until process pid is no longer the foreground process
 */
Block until process pid is no longer the foreground process
Block until process pid is no longer the foreground process
void waitfg(pid_t pid)
{
    dprintf("waitfg started!!\n");
    struct job_t* job = getjobpid(jobs, pid);
    while(job->state == FG) sleep(1); 
    dprintf("return from waitfg\n");
    return;
}
void waitfg ( pid_t pid ) { dprintf ( " \n " ) ; struct job_t * job = getjobpid ( jobs , pid ) ; while ( job -> state == FG ) sleep ( 1 ) ; dprintf ( " \n " ) ; return ; }
waitfg - Block until process pid is no longer the foreground process
waitfg - Block until process pid is no longer the foreground process
// sleep until job is running on FG