From 52e36feda153e70cd08d624df73035b7e59a95ef Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Wed, 17 Aug 2011 14:44:16 -0400 Subject: Call evthread_use_windows_threads when running with IOCP on windows --- src/common/compat_libevent.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/common/compat_libevent.c b/src/common/compat_libevent.c index c338dd6c05..8752de7492 100644 --- a/src/common/compat_libevent.c +++ b/src/common/compat_libevent.c @@ -19,6 +19,7 @@ #ifdef HAVE_EVENT2_EVENT_H #include +#include #else #include #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) -- cgit v1.2.3-54-g00ecf