mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-10 13:04:23 -04:00
Merge remote-tracking branch 'vm/21_fix_nmake_build'
This commit is contained in:
commit
ba696dce0b
@ -334,13 +334,7 @@
|
|||||||
#define EVENT__TIME_WITH_SYS_TIME 1
|
#define EVENT__TIME_WITH_SYS_TIME 1
|
||||||
|
|
||||||
/* Version number of package */
|
/* Version number of package */
|
||||||
<<<<<<< HEAD
|
|
||||||
#define EVENT__VERSION "2.1.0-alpha-dev"
|
#define EVENT__VERSION "2.1.0-alpha-dev"
|
||||||
||||||| merged common ancestors
|
|
||||||
#define EVENT__VERSION "2.0.16-stable-dev"
|
|
||||||
=======
|
|
||||||
#define EVENT__VERSION "2.0.17-stable"
|
|
||||||
>>>>>>> origin/patches-2.0
|
|
||||||
|
|
||||||
/* Define to appropriate substitue if compiler doesnt have __func__ */
|
/* Define to appropriate substitue if compiler doesnt have __func__ */
|
||||||
#define EVENT____func__ __FUNCTION__
|
#define EVENT____func__ __FUNCTION__
|
||||||
|
10
event.c
10
event.c
@ -2129,6 +2129,7 @@ evthread_notify_base_default(struct event_base *base)
|
|||||||
return (r < 0 && errno != EAGAIN) ? -1 : 0;
|
return (r < 0 && errno != EAGAIN) ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef EVENT__HAVE_EVENTFD
|
||||||
/* Helper callback: wake an event_base from another thread. This version
|
/* Helper callback: wake an event_base from another thread. This version
|
||||||
* assumes that you have a working eventfd() implementation. */
|
* assumes that you have a working eventfd() implementation. */
|
||||||
static int
|
static int
|
||||||
@ -2142,6 +2143,8 @@ evthread_notify_base_eventfd(struct event_base *base)
|
|||||||
|
|
||||||
return (r < 0) ? -1 : 0;
|
return (r < 0) ? -1 : 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/** Tell the thread currently running the event_loop for base (if any) that it
|
/** Tell the thread currently running the event_loop for base (if any) that it
|
||||||
* needs to stop waiting in its dispatch function (if it is) and process all
|
* needs to stop waiting in its dispatch function (if it is) and process all
|
||||||
@ -2963,6 +2966,7 @@ event_set_mem_functions(void *(*malloc_fn)(size_t sz),
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef EVENT__HAVE_EVENTFD
|
||||||
static void
|
static void
|
||||||
evthread_notify_drain_eventfd(evutil_socket_t fd, short what, void *arg)
|
evthread_notify_drain_eventfd(evutil_socket_t fd, short what, void *arg)
|
||||||
{
|
{
|
||||||
@ -2978,6 +2982,7 @@ evthread_notify_drain_eventfd(evutil_socket_t fd, short what, void *arg)
|
|||||||
base->is_notify_pending = 0;
|
base->is_notify_pending = 0;
|
||||||
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
EVBASE_RELEASE_LOCK(base, th_base_lock);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
evthread_notify_drain_default(evutil_socket_t fd, short what, void *arg)
|
evthread_notify_drain_default(evutil_socket_t fd, short what, void *arg)
|
||||||
@ -3012,13 +3017,16 @@ evthread_make_base_notifiable(struct event_base *base)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef EVENT__HAVE_EVENTFD
|
||||||
base->th_notify_fd[0] = evutil_eventfd_(0,
|
base->th_notify_fd[0] = evutil_eventfd_(0,
|
||||||
EVUTIL_EFD_CLOEXEC|EVUTIL_EFD_NONBLOCK);
|
EVUTIL_EFD_CLOEXEC|EVUTIL_EFD_NONBLOCK);
|
||||||
if (base->th_notify_fd[0] >= 0) {
|
if (base->th_notify_fd[0] >= 0) {
|
||||||
base->th_notify_fd[1] = -1;
|
base->th_notify_fd[1] = -1;
|
||||||
notify = evthread_notify_base_eventfd;
|
notify = evthread_notify_base_eventfd;
|
||||||
cb = evthread_notify_drain_eventfd;
|
cb = evthread_notify_drain_eventfd;
|
||||||
} else if (evutil_make_internal_pipe_(base->th_notify_fd) == 0) {
|
} else
|
||||||
|
#endif
|
||||||
|
if (evutil_make_internal_pipe_(base->th_notify_fd) == 0) {
|
||||||
notify = evthread_notify_base_default;
|
notify = evthread_notify_base_default;
|
||||||
cb = evthread_notify_drain_default;
|
cb = evthread_notify_drain_default;
|
||||||
} else {
|
} else {
|
||||||
|
@ -65,6 +65,10 @@ extern "C" {
|
|||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
|
#ifdef EVENT__HAVE_GETADDRINFO
|
||||||
|
/* for EAI_* definitions. */
|
||||||
|
#include <ws2tcpip.h>
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -757,7 +757,7 @@ test_evbuffer_add_file(void *ptr)
|
|||||||
data = malloc(1024*512);
|
data = malloc(1024*512);
|
||||||
tt_assert(data);
|
tt_assert(data);
|
||||||
for (i = 0; i < datalen; ++i)
|
for (i = 0; i < datalen; ++i)
|
||||||
data[i] = evutil_weakrand_();
|
data[i] = (char)evutil_weakrand_();
|
||||||
} else {
|
} else {
|
||||||
data = strdup("here is a relatively small string.");
|
data = strdup("here is a relatively small string.");
|
||||||
tt_assert(data);
|
tt_assert(data);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user