]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Merge remote-tracking branch 'public/bug4457_022' into bug4457_master
authorNick Mathewson <nickm@torproject.org>
Mon, 14 Nov 2011 22:59:42 +0000 (17:59 -0500)
committerNick Mathewson <nickm@torproject.org>
Mon, 14 Nov 2011 22:59:42 +0000 (17:59 -0500)
Conflicts:
src/common/compat_libevent.c

Resolving conflict by not taking 7363eae13cb8 ("Use the
EVENT_BASE_FLAG_NOLOCK flag to prevent socketpair() invocation"): in
Tor 0.2.3.x, we _do_ sometimes use notifiable event bases.

1  2 
src/common/compat_libevent.c

index 32017387012fe6c3eeed4b20b6e461a98b1efd4f,ddb2da68aa40fc6c38fc904cb1869a84bace56ce..c53346118fdb23fff52bd79e566bbcca0e560394
@@@ -196,25 -179,12 +196,26 @@@ tor_libevent_initialize(tor_libevent_cf
  #ifdef HAVE_EVENT2_EVENT_H
    {
      struct event_config *cfg = event_config_new();
+     tor_assert(cfg);
  
 -    /* In 0.2.2, we don't use locking at all.  Telling Libevent not to try to
 -     * turn it on can avoid a needless socketpair() attempt.
 -     */
 -    event_config_set_flag(cfg, EVENT_BASE_FLAG_NOLOCK);
 +#if defined(MS_WINDOWS) && defined(USE_BUFFEREVENTS)
 +    if (! torcfg->disable_iocp) {
 +      evthread_use_windows_threads();
 +      event_config_set_flag(cfg, EVENT_BASE_FLAG_STARTUP_IOCP);
 +      using_iocp_bufferevents = 1;
 +    }
 +#endif
 +
 +#if defined(LIBEVENT_VERSION_NUMBER) && LIBEVENT_VERSION_NUMBER >= V(2,0,7)
 +    if (torcfg->num_cpus > 0)
 +      event_config_set_num_cpus_hint(cfg, torcfg->num_cpus);
 +#endif
 +
 +#if LIBEVENT_VERSION_NUMBER >= V(2,0,9)
 +    /* We can enable changelist support with epoll, since we don't give
 +     * Libevent any dup'd fds.  This lets us avoid some syscalls. */
 +    event_config_set_flag(cfg, EVENT_BASE_FLAG_EPOLL_USE_CHANGELIST);
 +#endif
  
      the_event_base = event_base_new_with_config(cfg);