Created
August 14, 2010 15:59
-
-
Save stanaka/524427 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff -ur libevent-1.3b.original/event.c libevent-1.3b/event.c | |
--- libevent-1.3b.original/event.c 2007-02-16 09:49:06.000000000 +0900 | |
+++ libevent-1.3b/event.c 2010-08-15 00:58:14.000000000 +0900 | |
@@ -790,13 +790,13 @@ | |
docount = 0; | |
if (docount) | |
- base->event_count--; | |
+ __sync_sub_and_fetch(&(base->event_count), 1); | |
ev->ev_flags &= ~queue; | |
switch (queue) { | |
case EVLIST_ACTIVE: | |
if (docount) | |
- base->event_count_active--; | |
+ __sync_sub_and_fetch(&(base->event_count_active), 1); | |
TAILQ_REMOVE(base->activequeues[ev->ev_pri], | |
ev, ev_active_next); | |
break; | |
@@ -832,13 +832,13 @@ | |
docount = 0; | |
if (docount) | |
- base->event_count++; | |
+ __sync_add_and_fetch(&(base->event_count), 1); | |
ev->ev_flags |= queue; | |
switch (queue) { | |
case EVLIST_ACTIVE: | |
if (docount) | |
- base->event_count_active++; | |
+ __sync_add_and_fetch(&(base->event_count_active), 1); | |
TAILQ_INSERT_TAIL(base->activequeues[ev->ev_pri], | |
ev,ev_active_next); | |
break; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment