4 #if defined(__GNUC__) && defined(__i386__)
5 /* force_align_arg_pointer is required for proper function arguments aligning
6 * when SSE code is used. Some systems (Windows, QNX) do not guarantee our
7 * thread functions will be properly aligned on the stack, even though GCC may
8 * generate code with the assumption that it is. */
9 #define FORCE_ALIGN __attribute__((force_align_arg_pointer))
15 #define WIN32_LEAN_AND_MEAN
17 #elif defined(__APPLE__)
18 #include <dispatch/dispatch.h>
20 #include <semaphore.h>
23 void althrd_setname(const char *name
);
29 using native_type
= HANDLE
;
30 #elif defined(__APPLE__)
31 using native_type
= dispatch_semaphore_t
;
33 using native_type
= sem_t
;
38 semaphore(unsigned int initial
=0);
39 semaphore(const semaphore
&) = delete;
42 semaphore
& operator=(const semaphore
&) = delete;
46 bool try_wait() noexcept
;
51 #endif /* AL_THREADS_H */