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.
This commit is contained in:
Christopher Faylor
2010-03-12 23:13:48 +00:00
parent 36960dec37
commit 084ea5108e
18 changed files with 48 additions and 74 deletions

View File

@@ -258,7 +258,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
mapaddr = NULL;
}
debug_printf ("MapViewOfFileEx h0 %p, i %d failed, %E", h0, i);
low_priority_sleep (0);
yield ();
continue;
}
@@ -313,7 +313,7 @@ pinfo::init (pid_t n, DWORD flag, HANDLE h0)
loop:
release ();
if (h0)
low_priority_sleep (0);
yield ();
}
if (h)
@@ -978,7 +978,7 @@ _pinfo::sync_proc_pipe ()
{
if (wr_proc_pipe && wr_proc_pipe != INVALID_HANDLE_VALUE)
while (wr_proc_pipe_owner != GetCurrentProcessId ())
low_priority_sleep (0);
yield ();
}
/* function to send a "signal" to the parent when something interesting happens