mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-11-28 22:31:06 +01:00
BUILD: kqueue/threads: Add test on MAX_THREADS to avoid warnings when complied without threads
This is the same patch than the previous one ("BUILD: epoll/threads: Add test on
MAX_THREADS to avoid warnings when complied without threads ").
It should be backported in 1.8 with the commit 7a2364d4 ("BUG/MEDIUM:
kqueue/threads: use one kqueue_fd per thread").
This commit is contained in:
parent
3e805ed08e
commit
727c89b3df
@ -161,7 +161,7 @@ static int init_kqueue_per_thread()
|
|||||||
if (kev == NULL)
|
if (kev == NULL)
|
||||||
goto fail_alloc;
|
goto fail_alloc;
|
||||||
|
|
||||||
if (tid) {
|
if (MAX_THREADS > 1 && tid) {
|
||||||
kqueue_fd[tid] = kqueue();
|
kqueue_fd[tid] = kqueue();
|
||||||
if (kqueue_fd[tid] < 0)
|
if (kqueue_fd[tid] < 0)
|
||||||
goto fail_fd;
|
goto fail_fd;
|
||||||
@ -184,7 +184,7 @@ static int init_kqueue_per_thread()
|
|||||||
|
|
||||||
static void deinit_kqueue_per_thread()
|
static void deinit_kqueue_per_thread()
|
||||||
{
|
{
|
||||||
if (tid)
|
if (MAX_THREADS > 1 && tid)
|
||||||
close(kqueue_fd[tid]);
|
close(kqueue_fd[tid]);
|
||||||
|
|
||||||
free(kev);
|
free(kev);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user