mirror of
https://github.com/lxsang/ant-http
synced 2024-12-26 00:38:21 +01:00
fix deadlock
This commit is contained in:
parent
ee5c630052
commit
64e912ab6e
@ -34,6 +34,8 @@ static void stop(antd_scheduler_t* scheduler)
|
|||||||
pthread_mutex_destroy(&scheduler->scheduler_lock);
|
pthread_mutex_destroy(&scheduler->scheduler_lock);
|
||||||
pthread_mutex_destroy(&scheduler->worker_lock);
|
pthread_mutex_destroy(&scheduler->worker_lock);
|
||||||
pthread_mutex_destroy(&scheduler->pending_lock);
|
pthread_mutex_destroy(&scheduler->pending_lock);
|
||||||
|
sem_unlink("scheduler");
|
||||||
|
sem_unlink("worker");
|
||||||
sem_close(scheduler->scheduler_sem);
|
sem_close(scheduler->scheduler_sem);
|
||||||
sem_close(scheduler->worker_sem);
|
sem_close(scheduler->worker_sem);
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <semaphore.h>
|
#include <semaphore.h>
|
||||||
|
#include <fcntl.h>
|
||||||
#define N_PRIORITY 10
|
#define N_PRIORITY 10
|
||||||
#define NORMAL_PRIORITY ((int)((N_PRIORITY - 1) / 2))
|
#define NORMAL_PRIORITY ((int)((N_PRIORITY - 1) / 2))
|
||||||
#define LOW_PRIORITY (N_PRIORITY - 1)
|
#define LOW_PRIORITY (N_PRIORITY - 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user