From: Eli Zaretskii Date: Tue, 25 Mar 2014 16:00:37 +0000 (+0200) Subject: Speed up thread startup on MS-Windows. X-Git-Tag: emacs-25.0.90~2612^2~709^2~1165 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=defd53bdc5ef9d75fa112487d76f4d7a4cb9fe92;p=emacs.git Speed up thread startup on MS-Windows. src/w32.c (w32_delayed_load): Call DisableThreadLibraryCalls on the DLL handle, to speed up thread startup. --- diff --git a/src/ChangeLog b/src/ChangeLog index 44ebe76555c..31d90663206 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2014-03-25 Eli Zaretskii + + * w32.c (w32_delayed_load): Call DisableThreadLibraryCalls on the + DLL handle, to speed up thread startup. + 2014-03-25 Paul Eggert Handle sigmask better with nested signal handlers (Bug#15561). diff --git a/src/w32.c b/src/w32.c index 8802e13e71d..1ffb6ec171f 100644 --- 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; } }