diff options
author | Christopher Faylor <me@cgf.cx> | 2011-07-31 00:50:23 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2011-07-31 00:50:23 +0400 |
commit | 53ad6f1394aa625e4b75a29e010651e22770e367 (patch) | |
tree | 55b4385d09ada46d2b4966c726f946c444544504 /winsup/cygwin/cygthread.cc | |
parent | f7e198a665edf1b4d553be353999b4e1b7075c3a (diff) |
* 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.
Diffstat (limited to 'winsup/cygwin/cygthread.cc')
-rw-r--r-- | winsup/cygwin/cygthread.cc | 11 |
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 () { |