mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
queue signalled: make libvillas compile if eventfd is not available/ activated; add a switch in CMake file to deactivate eventfd independant of availability in OS
This commit is contained in:
parent
650af44620
commit
5f11bd5a19
2 changed files with 12 additions and 2 deletions
|
@ -63,7 +63,12 @@ else()
|
|||
endif()
|
||||
|
||||
# Check OS
|
||||
check_include_file("sys/eventfd.h" HAS_EVENTFD)
|
||||
# Use the switch NO_EVENTFD to deactivate eventfd usage indepentent of availability on OS
|
||||
if(NOT ${NO_EVENTFD} MATCHES "1")
|
||||
check_include_file("sys/eventfd.h" HAS_EVENTFD)
|
||||
else()
|
||||
set(HAS_EVENTFD 0)
|
||||
endif()
|
||||
check_include_file("semaphore.h" HAS_SEMAPHORE)
|
||||
check_include_file("sys/mman.h" HAS_MMAN)
|
||||
|
||||
|
|
|
@ -47,8 +47,13 @@ int queue_signalled_init(struct queue_signalled *qs, size_t size, struct memory_
|
|||
#ifdef __linux__
|
||||
if (flags & QUEUE_SIGNALLED_PROCESS_SHARED)
|
||||
qs->mode = QUEUE_SIGNALLED_PTHREAD;
|
||||
else
|
||||
else {
|
||||
#ifdef HAS_EVENTFD
|
||||
qs->mode = QUEUE_SIGNALLED_EVENTFD;
|
||||
#else
|
||||
qs->mode = QUEUE_SIGNALLED_PTHREAD;
|
||||
#endif
|
||||
}
|
||||
#elif defined(__APPLE__)
|
||||
if (flags & QUEUE_SIGNALLED_PROCESS_SHARED)
|
||||
qs->mode = QUEUE_SIGNALLED_PTHREAD;
|
||||
|
|
Loading…
Add table
Reference in a new issue