20 #ifndef WINPR_SYNCH_PRIVATE_H
21 #define WINPR_SYNCH_PRIVATE_H
23 #include <winpr/config.h>
25 #include <winpr/platform.h>
27 #include <winpr/synch.h>
29 #include "../handle/handle.h"
30 #include "../thread/apc.h"
35 #define WINPR_PIPE_SEMAPHORE 1
40 #include <semaphore.h>
41 #include <mach/mach.h>
42 #include <mach/semaphore.h>
43 #include <mach/task.h>
44 #define winpr_sem_t semaphore_t
47 #include <semaphore.h>
48 #define winpr_sem_t sem_t
55 pthread_mutex_t mutex;
68 #ifdef WINPR_HAVE_SYS_TIMERFD_H
72 #include <sys/timerfd.h>
73 #define TIMER_IMPL_TIMERFD
75 #elif defined(WITH_POSIX_TIMER)
77 #define TIMER_IMPL_POSIX
79 #elif defined(__APPLE__)
80 #define TIMER_IMPL_DISPATCH
81 #include <dispatch/dispatch.h>
83 #warning missing timer implementation
94 PTIMERAPCROUTINE pfnCompletionRoutine;
95 LPVOID lpArgToCompletionRoutine;
97 #ifdef TIMER_IMPL_TIMERFD
98 struct itimerspec timeout;
101 #ifdef TIMER_IMPL_POSIX
102 WINPR_EVENT_IMPL event;
104 struct itimerspec timeout;
107 #ifdef TIMER_IMPL_DISPATCH
108 WINPR_EVENT_IMPL event;
109 dispatch_queue_t queue;
110 dispatch_source_t source;
115 WINPR_APC_ITEM apcItem;
127 pthread_mutex_t mutex;
129 pthread_mutex_t cond_mutex;
130 struct sched_param param;
133 WINPR_TIMER_QUEUE_TIMER* activeHead;
134 WINPR_TIMER_QUEUE_TIMER* inactiveHead;
146 WAITORTIMERCALLBACK Callback;
150 struct timespec StartTime;
151 struct timespec ExpirationTime;
153 WINPR_TIMER_QUEUE* timerQueue;
154 WINPR_TIMER_QUEUE_TIMER* next;