Activate shared memory and semaphores
This commit is contained in:
parent
160d66c9c4
commit
80afbc9473
@ -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);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user