summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/cygthread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/cygthread.cc')
-rw-r--r--winsup/cygwin/cygthread.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index ef8a4d575..50a265b4b 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -186,6 +186,17 @@ out:
return info;
}
+/* This function is called via QueueUserAPC. Apparently creating threads
+ asynchronously is a huge performance win on Win64. */
+void CALLBACK
+cygthread::async_create (ULONG_PTR arg)
+{
+ cygthread *that = (cygthread *) arg;
+ that->create ();
+ ::SetThreadPriority (that->h, THREAD_PRIORITY_HIGHEST);
+ that->zap_h ();
+}
+
void
cygthread::create ()
{