From c16e68448c546c99d3c0d1a1447214a55e137b35 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Tue, 4 May 2010 13:27:36 -0400 Subject: [PATCH] Rename current_base symbol to event_global_current_base_ The "current_base" symbol was never actually declared in an exported header; it's hideously deprecated, and it was the one remaining exported symbol (fwict) that was prefixed with neither ev nor bufferevent nor _ev nor _bufferevent. codesearch.google.com turns up no actual attempts to use our current_base from outside libevent. --- event.c | 6 ++++-- include/event2/event.h | 6 ++---- include/event2/event_compat.h | 4 ++-- test/regress.c | 1 + 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/event.c b/event.c index 6336e4e6..f7b69f52 100644 --- a/event.c +++ b/event.c @@ -117,10 +117,12 @@ static const struct eventop *eventops[] = { }; /* Global state; deprecated */ -struct event_base *current_base = NULL; +struct event_base *event_global_current_base_ = NULL; +#define current_base event_global_current_base_ +extern struct event_base *evsig_base; /* Global state */ -extern struct event_base *evsig_base; + static int use_monotonic; /* Prototypes */ diff --git a/include/event2/event.h b/include/event2/event.h index 116010e1..ba9ce3d8 100644 --- a/include/event2/event.h +++ b/include/event2/event.h @@ -85,11 +85,9 @@ void event_debug_unassign(struct event *); /** Initialize the event API. - Use event_base_new() to initialize a new event base, but does not set - the current_base global. If using only event_base_new(), each event - added must have an event base set with event_base_set() + Use event_base_new() to initialize a new event base. - @see event_base_set(), event_base_free(), event_init(), + @see event_base_set(), event_base_free(), event_base_new_with_config() */ struct event_base *event_base_new(void); diff --git a/include/event2/event_compat.h b/include/event2/event_compat.h index 03bf2eba..f59850a0 100644 --- a/include/event2/event_compat.h +++ b/include/event2/event_compat.h @@ -53,8 +53,8 @@ extern "C" { Initialize the event API. The event API needs to be initialized with event_init() before it can be - used. Sets the current_base global representing the default base for - events that have no base associated with them. + used. Sets the global current base that gets used for events that have no + base associated with them. @deprecated This function is deprecated because it replaces the "current" event_base, and is totally unsafe for multithreaded use. The replacement diff --git a/test/regress.c b/test/regress.c index 513c3c87..532542a6 100644 --- a/test/regress.c +++ b/test/regress.c @@ -713,6 +713,7 @@ end: #ifndef WIN32 static void signal_cb(evutil_socket_t fd, short event, void *arg); +#define current_base event_global_current_base_ extern struct event_base *current_base; static void