Activate shared memory and semaphores

This commit is contained in:
zenon 2018-06-07 10:09:45 +02:00
parent 160d66c9c4
commit 80afbc9473

View File

@ -170,9 +170,8 @@ void printGraph()
}
}
void putItem(int itemValue)
void putSolution(sem_t sUsedSpace, sem_t sFreeSpace, int *solution)
{
shared->validItems++;
shared->data[shared->tail] = itemValue;
shared->tail = (shared->tail + 1) % MAX_ITEMS;
}
@ -260,7 +259,6 @@ int main(int argc, char *argv[])
sigaction(SIGINT, &sa, NULL);
sigaction(SIGTERM, &sa, NULL);
/*
int shmfd = shm_open(SHM_NAME, O_RDWR | O_CREAT, PERMISSION);
if (shmfd == -1) {
perror(pname);
@ -279,8 +277,7 @@ int main(int argc, char *argv[])
if (sFreeSpace == SEM_FAILED || sUsedSpace == SEM_FAILED || sWriteEnd == SEM_FAILED) {
perror(pname);
exit(EXIT_FAILURE);
}
*/
}
parse(argc, argv);