aboutsummaryrefslogtreecommitdiff
path: root/src/common/compat_libevent.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-08-17 14:44:16 -0400
committerNick Mathewson <nickm@torproject.org>2011-08-17 14:44:16 -0400
commit52e36feda153e70cd08d624df73035b7e59a95ef (patch)
treed17dcb723409e64fc3b1e0ae91c04e33763daff8 /src/common/compat_libevent.c
parentd2cd67c83fff5097d214c8c86169054a5558b902 (diff)
downloadtor-52e36feda153e70cd08d624df73035b7e59a95ef.tar
tor-52e36feda153e70cd08d624df73035b7e59a95ef.tar.gz
Call evthread_use_windows_threads when running with IOCP on windows
Diffstat (limited to 'src/common/compat_libevent.c')
-rw-r--r--src/common/compat_libevent.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c
index c338dd6c0..8752de749 100644
--- a/src/common/compat_libevent.c
+++ b/src/common/compat_libevent.c
@@ -19,6 +19,7 @@
#ifdef HAVE_EVENT2_EVENT_H
#include <event2/event.h>
+#include <event2/thread.h>
#else
#include <event.h>
#endif
@@ -183,8 +184,10 @@ tor_libevent_initialize(tor_libevent_cfg *torcfg)
struct event_config *cfg = event_config_new();
#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);
+ }
#endif
#if defined(LIBEVENT_VERSION_NUMBER) && LIBEVENT_VERSION_NUMBER >= V(2,0,7)