Call evthread_use_windows_threads when running with IOCP on windows

This commit is contained in:
Nick Mathewson 2011-08-17 14:44:16 -04:00
parent d2cd67c83f
commit 52e36feda1
2 changed files with 7 additions and 1 deletions

3
changes/le-win-threads Normal file
View File

@ -0,0 +1,3 @@
o Major bugfixes (IOCP):
- When using IOCP on windows, we need to enable Libevent windows threading
support. Bugfix on 0.2.3.1-alpha.

View File

@ -19,6 +19,7 @@
#ifdef HAVE_EVENT2_EVENT_H #ifdef HAVE_EVENT2_EVENT_H
#include <event2/event.h> #include <event2/event.h>
#include <event2/thread.h>
#else #else
#include <event.h> #include <event.h>
#endif #endif
@ -183,8 +184,10 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
struct event_config *cfg = event_config_new(); struct event_config *cfg = event_config_new();
#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS) #if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
if (! torcfg->disable_iocp) if (! torcfg->disable_iocp) {
evthread_use_windows_threads();
event_config_set_flag(cfg, EVENT_BASE_FLAG_STARTUP_IOCP); event_config_set_flag(cfg, EVENT_BASE_FLAG_STARTUP_IOCP);
}
#endif #endif
#if defined(LIBEVENT_VERSION_NUMBER) && LIBEVENT_VERSION_NUMBER >= V(2,0,7) #if defined(LIBEVENT_VERSION_NUMBER) && LIBEVENT_VERSION_NUMBER >= V(2,0,7)