diff options
author | Rickard Green <[email protected]> | 2015-09-09 18:16:04 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2015-09-09 18:16:04 +0200 |
commit | fff7daa154a1b96b3e11d74bd2d60fc3a41aa832 (patch) | |
tree | 4c7213260ecc92a0f4ab34c1129fef478872f029 /erts/include/internal/pthread/ethr_event.h | |
parent | 59911612aec5f18b099dbc518089dd3ce48fdd97 (diff) | |
parent | 5a02ed2f3505f5ed3282c6b43963e19e63e49905 (diff) | |
download | otp-fff7daa154a1b96b3e11d74bd2d60fc3a41aa832.tar.gz otp-fff7daa154a1b96b3e11d74bd2d60fc3a41aa832.tar.bz2 otp-fff7daa154a1b96b3e11d74bd2d60fc3a41aa832.zip |
Merge branch 'rickard/event-tmo/OTP-12954' into maint
* rickard/event-tmo/OTP-12954:
Fix ethread events with timeout
Diffstat (limited to 'erts/include/internal/pthread/ethr_event.h')
-rw-r--r-- | erts/include/internal/pthread/ethr_event.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/erts/include/internal/pthread/ethr_event.h b/erts/include/internal/pthread/ethr_event.h index 74cfa68e16..deb4b29686 100644 --- a/erts/include/internal/pthread/ethr_event.h +++ b/erts/include/internal/pthread/ethr_event.h @@ -83,12 +83,22 @@ ETHR_INLINE_FUNC_NAME_(ethr_event_reset)(ethr_event *e) #elif defined(ETHR_PTHREADS) /* --- Posix mutex/cond pipe/select implementation of events ---------------- */ +#if defined(__APPLE__) && defined(__MACH__) && !defined(__DARWIN__) +# define __DARWIN__ 1 +#endif + +#ifdef __DARWIN__ +typedef struct ethr_event_fdsets___ ethr_event_fdsets__; +#endif typedef struct { ethr_atomic32_t state; pthread_mutex_t mtx; pthread_cond_t cnd; int fd[2]; +#ifdef __DARWIN__ + ethr_event_fdsets__ *fdsets; +#endif } ethr_event; #define ETHR_EVENT_OFF_WAITER_SELECT__ ((ethr_sint32_t) -2) @@ -148,6 +158,7 @@ ETHR_INLINE_FUNC_NAME_(ethr_event_reset)(ethr_event *e) #endif int ethr_event_init(ethr_event *e); +int ethr_event_prepare_timed(ethr_event *e); int ethr_event_destroy(ethr_event *e); int ethr_event_wait(ethr_event *e); int ethr_event_swait(ethr_event *e, int spincount); |