* cygthread.cc (cygthread::async_create): Define new function.

* cygthread.h (cygthread::create): Use correct regparm.
(cygthread::standalone): Delete from class and from all constructors.
(cygthread::cygthread): Use three only arguments for detached threads, and
start the thread via QueueUserAPC/async_create.
* dcrt0.cc (dll_crt0_0): Remove handling for wincap.has_buggy_thread_startup.
(dll_crt0_1): Ditto.
* wincap.cc: Ditto throughout.
* wincap.h: Ditto.
This commit is contained in:
Christopher Faylor
2011-07-30 20:50:23 +00:00
parent f7e198a665
commit 53ad6f1394
6 changed files with 37 additions and 30 deletions

View File

@@ -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 ()
{