8 #if defined(__GNUC__) && defined(__i386__)
9 /* force_align_arg_pointer is required for proper function arguments aligning
10 * when SSE code is used. Some systems (Windows, QNX) do not guarantee our
11 * thread functions will be properly aligned on the stack, even though GCC may
12 * generate code with the assumption that it is. */
13 #define FORCE_ALIGN __attribute__((force_align_arg_pointer))
19 #define WIN32_LEAN_AND_MEAN
21 #elif defined(__APPLE__)
22 #include <dispatch/dispatch.h>
24 #include <semaphore.h>
27 void althrd_setname(const char *name
);
33 using native_type
= HANDLE
;
34 #elif defined(__APPLE__)
35 using native_type
= dispatch_semaphore_t
;
37 using native_type
= sem_t
;
42 semaphore(unsigned int initial
=0);
43 semaphore(const semaphore
&) = delete;
46 semaphore
& operator=(const semaphore
&) = delete;
50 bool try_wait() noexcept
;
55 #endif /* AL_THREADS_H */