I have been using libevent in multithreaded code, where more than one event 
queue is used (i.e. event_init() is called multiple times,) and was bitten by 
the fact that current_base is updated on each call to event_init().  This 
becomes a problem when attempting to use the evhttp support in such an 
environment, which does not support explicit event_base specifications.

The attached patch only initializes current_base to the first one created so 
that the behavior is at least predictable and controllable.


--

paul
--- libevent-1.3e.orig/event.c	2007-10-29 14:51:55.000000000 -0500
+++ libevent-1.3e.tmp/event.c	2007-10-29 20:07:18.000000000 -0500
@@ -218,7 +218,8 @@
 	/* allocate a single active event queue */
 	event_base_priority_init(base, 1);
 
-	current_base = base;
+        if( current_base == NULL )
+            current_base = base;
 	return (base);
 }
 
_______________________________________________
Libevent-users mailing list
Libevent-users@monkey.org
http://monkey.org/mailman/listinfo/libevent-users

Reply via email to