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))
14 #if defined(__APPLE__)
15 #include <dispatch/dispatch.h>
16 #elif !defined(_WIN32)
17 #include <semaphore.h>
20 void althrd_setname(const char *name
);
26 using native_type
= void*;
27 #elif defined(__APPLE__)
28 using native_type
= dispatch_semaphore_t
;
30 using native_type
= sem_t
;
35 semaphore(unsigned int initial
=0);
36 semaphore(const semaphore
&) = delete;
39 semaphore
& operator=(const semaphore
&) = delete;
43 bool try_wait() noexcept
;
48 #endif /* AL_THREADS_H */