summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root>2011-07-20 00:58:45 +0000
committerroot <root>2011-07-20 00:58:45 +0000
commit8a3ce7e75f92b4e43f6ab8171559b7f282066f20 (patch)
tree0f94f1b0efd58867e92fedb3e419739e15850422
parentda7d355be23e019506a1413fb4ab2881bd1e6059 (diff)
temporary fence hack
-rw-r--r--ev.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ev.c b/ev.c
index c514a77..0c4e189 100644
--- a/ev.c
+++ b/ev.c
@@ -1466,17 +1466,17 @@ evpipe_write (EV_P_ EV_ATOMIC_T *flag)
*flag = 1;
- ECB_MEMORY_FENCE_RELEASE;
+ ECB_MEMORY_FENCE_RELEASE; /* make sure flag is visible before the wakeup */
pipe_write_skipped = 1;
- ECB_MEMORY_FENCE;
+ ECB_MEMORY_FENCE; /* make sure pipe_write_skipped is visible before we check pipe_write_wanted */
if (pipe_write_wanted)
{
int old_errno;
- pipe_write_skipped = 0; /* optimisation only */
+ pipe_write_skipped = 0; /* just an optimsiation, no fence needed */
old_errno = errno; /* save errno because write will clobber it */
@@ -2618,7 +2618,7 @@ ev_run (EV_P_ int flags)
/* from now on, we want a pipe-wake-up */
pipe_write_wanted = 1;
- ECB_MEMORY_FENCE;
+ ECB_MEMORY_FENCE; /* amke sure pipe_write_wanted is visible before we check for potential skips */
if (expect_true (!(flags & EVRUN_NOWAIT || idleall || !activecnt || pipe_write_skipped)))
{
@@ -2670,7 +2670,7 @@ ev_run (EV_P_ int flags)
backend_poll (EV_A_ waittime);
assert ((loop_done = EVBREAK_CANCEL, 1)); /* assert for side effect */
- pipe_write_wanted = 0;
+ pipe_write_wanted = 0; /* just an optimsiation, no fence needed */
if (pipe_write_skipped)
{