diff --git a/generator.c b/generator.c index 28fae05..a4e3f76 100644 --- a/generator.c +++ b/generator.c @@ -229,14 +229,14 @@ void putSolution(int *solution) wait_sem(sFreeSpace); shared->data[shared->tail] = -1; shared->tail = (shared->tail + 1) % CIRC_BUF_SIZE; - wait_sem(sUsedSpace); + sem_post(sUsedSpace); } else { int i = 0; while (solution[i] != -1) { wait_sem(sFreeSpace); shared->data[shared->tail] = solution[i]; shared->tail = (shared->tail + 1) % CIRC_BUF_SIZE; - wait_sem(sUsedSpace); + sem_post(sUsedSpace); i++; } }