]> git.eshelyaron.com Git - emacs.git/commitdiff
Speed up thread startup on MS-Windows.
authorEli Zaretskii <eliz@gnu.org>
Tue, 25 Mar 2014 16:00:37 +0000 (18:00 +0200)
committerEli Zaretskii <eliz@gnu.org>
Tue, 25 Mar 2014 16:00:37 +0000 (18:00 +0200)
 src/w32.c (w32_delayed_load): Call DisableThreadLibraryCalls on the
 DLL handle, to speed up thread startup.

src/ChangeLog
src/w32.c

index 44ebe76555c0d50791442c0ff6732ab312f8230c..31d9066320622215d0d4f621ceac7d3415a82904 100644 (file)
@@ -1,3 +1,8 @@
+2014-03-25  Eli Zaretskii  <eliz@gnu.org>
+
+       * w32.c (w32_delayed_load): Call DisableThreadLibraryCalls on the
+       DLL handle, to speed up thread startup.
+
 2014-03-25  Paul Eggert  <eggert@cs.ucla.edu>
 
        Handle sigmask better with nested signal handlers  (Bug#15561).
index 8802e13e71df7fa8e82d1bdbfc8f8fe6ef1cef41..1ffb6ec171fbddeb714ec48777d77d56fee6d23c 100644 (file)
--- a/src/w32.c
+++ b/src/w32.c
@@ -8702,6 +8702,13 @@ w32_delayed_load (Lisp_Object library_id)
                               /* Possibly truncated */
                               ? make_specified_string (name, -1, len, 1)
                               : Qnil);
+               /* This prevents thread start and end notifications
+                  from being sent to the DLL, for every thread we
+                  start.  We don't need those notifications because
+                  threads we create never use any of these DLLs, only
+                  the main thread uses them.  This is supposed to
+                  speed up thread creation.  */
+               DisableThreadLibraryCalls (dll_handle);
                break;
              }
          }