From 54bb040ef46c8c494d56743e58f9d2e82f992ec6 Mon Sep 17 00:00:00 2001 From: lxsang Date: Sun, 14 Oct 2018 11:02:27 +0200 Subject: [PATCH] fix deadlock --- libs/scheduler.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/scheduler.c b/libs/scheduler.c index cb46a66..a939d1a 100644 --- a/libs/scheduler.c +++ b/libs/scheduler.c @@ -153,13 +153,13 @@ void antd_scheduler_init(antd_scheduler_t* scheduler, int n) scheduler->workers_queue = NULL; scheduler->pending_task = 0 ; // init semaphore - scheduler->scheduler_sem = shm_open("scheduler", O_RDWR | O_CREAT, S_IRWXU); + scheduler->scheduler_sem = sem_open("scheduler", O_RDWR | O_CREAT, S_IRWXU); if (!scheduler->scheduler_sem) { LOG("Cannot open semaphore for scheduler\n"); exit(-1); } - scheduler->worker_sem = shm_open("worker", O_RDWR | O_CREAT, S_IRWXU); + scheduler->worker_sem = sem_open("worker", O_RDWR | O_CREAT, S_IRWXU); if (!scheduler->worker_sem) { LOG("Cannot open semaphore for workers\n");