Skip to content

Commit

Permalink
Parent now waits for child. Resolves smuos#7 issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
zoeada committed Oct 2, 2014
1 parent 41f0bca commit d2590a7
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mm.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ int main(int argc, char *argv[]) {
int med = median(pt, length);
fprintf(stdout, "%d ", med);
} else if (rc > 0) { // parent runs mean:
int avg = mean(pt, length);
int wc = wait(NULL); // waits until child has finished
int avg = mean(pt, length);
fprintf(stdout, "%d ", avg);
}

Expand Down

0 comments on commit d2590a7

Please sign in to comment.