--- libev/ev.c 2012/04/22 10:14:20 1.423 +++ libev/ev.c 2012/05/01 22:01:40 1.424 @@ -1846,6 +1846,8 @@ inline_speed void evpipe_write (EV_P_ EV_ATOMIC_T *flag) { + ECB_MEMORY_FENCE; /* push out the write before this function was called, acquire flag */ + if (expect_true (*flag)) return; @@ -1914,11 +1916,15 @@ pipe_write_skipped = 0; + ECB_MEMORY_FENCE; /* push out skipped, acquire flags */ + #if EV_SIGNAL_ENABLE if (sig_pending) { sig_pending = 0; + ECB_MEMORY_FENCE_RELEASE; + for (i = EV_NSIG - 1; i--; ) if (expect_false (signals [i].pending)) ev_feed_signal_event (EV_A_ i + 1); @@ -1930,6 +1936,8 @@ { async_pending = 0; + ECB_MEMORY_FENCE_RELEASE; + for (i = asynccnt; i--; ) if (asyncs [i]->sent) {