Skip to content

Commit fc425e7

Browse files
committed
Change sem_wait to sem_post in reader()
1 parent e024f48 commit fc425e7

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

reader.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,6 @@ void reader() {
4343

4444
pthread_mutex_unlock(&bufferMutex);
4545

46-
sem_wait(&filledSpaceSemaphore);
46+
sem_post(&filledSpaceSemaphore);
4747
}
48-
49-
for (int i = 0; i < nproc; i++) {
50-
printf("%s %lu %lu %lu %lu %lu %lu %lu %lu %lu %lu\n", stats[i].name,
51-
stats[i].user, stats[i].nice, stats[i].system, stats[i].idle,
52-
stats[i].iowait, stats[i].irq, stats[i].softirq, stats[i].steal,
53-
stats[i].guest, stats[i].guest_nice);
54-
}
55-
56-
// free(stats);
5748
}

0 commit comments

Comments
 (0)