diff options
author | Christopher Faylor <me@cgf.cx> | 2010-03-13 02:13:48 +0300 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-03-13 02:13:48 +0300 |
commit | 084ea5108e86738a09288268b186541b0c23920a (patch) | |
tree | 93ad21c3c750fe12e7792ff8679b87888992dc3d /winsup/cygwin/shared.cc | |
parent | 36960dec3721fccc8eb931787a2656cf715bfc39 (diff) |
Throughout change all calls of low_priority_sleep (0) to yield ().
* miscfuncs.cc (yield): Rename from low_priority_sleep. Remove all of the
logic which called Sleep() and just use SwitchToThread.
* miscfuncs.h (yield): Rename from low_priority_sleep.
(SLEEP_0_STAY_LOW): Delete unused define.
* shared.cc (memory_init): Move heap_init() call directly after shared memory
initialization to more closely mimic long-standing program flow.
* tty.cc (tty_list::terminate): Replace call to low_priority_sleep with Sleep.
Diffstat (limited to 'winsup/cygwin/shared.cc')
-rw-r--r-- | winsup/cygwin/shared.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/winsup/cygwin/shared.cc b/winsup/cygwin/shared.cc index 4a2489222..fcca6f40f 100644 --- a/winsup/cygwin/shared.cc +++ b/winsup/cygwin/shared.cc @@ -318,7 +318,7 @@ user_shared_initialize () else { while (!user_shared->cb) - low_priority_sleep (0); // Should be hit only very very rarely + yield (); // Should be hit only very very rarely if (user_shared->version != sversion) multiple_cygwin_problem ("user shared memory version", user_shared->version, sversion); else if (user_shared->cb != sizeof (*user_shared)) @@ -423,7 +423,7 @@ memory_init (bool init_cygheap) LONG smi = InterlockedExchange (&shared_mem_inited, -1); if (smi < 0) { - low_priority_sleep (0); + yield (); continue; } @@ -431,12 +431,13 @@ memory_init (bool init_cygheap) /* Initialize installation root dir */ init_installation_root (); - /* Installation root dir has been globally initialized */ cygwin_shared = (shared_info *) open_shared (L"shared", CYGWIN_VERSION_SHARED_DATA, cygwin_shared_h, sizeof (*cygwin_shared), SH_CYGWIN_SHARED); + heap_init (); + if (!smi) { cygwin_shared->initialize (); @@ -451,7 +452,6 @@ memory_init (bool init_cygheap) InterlockedExchange (&shared_mem_inited, smi); break; } - heap_init (); user_shared_create (false); } |