aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/cygthread.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2010-03-12 23:13:48 +0000
committerChristopher Faylor <me@cgf.cx>2010-03-12 23:13:48 +0000
commit084ea5108e86738a09288268b186541b0c23920a (patch)
tree93ad21c3c750fe12e7792ff8679b87888992dc3d /winsup/cygwin/cygthread.cc
parent36960dec3721fccc8eb931787a2656cf715bfc39 (diff)
downloadnewlib-084ea5108e86738a09288268b186541b0c23920a.zip
newlib-084ea5108e86738a09288268b186541b0c23920a.tar.gz
newlib-084ea5108e86738a09288268b186541b0c23920a.tar.bz2
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/cygthread.cc')
-rw-r--r--winsup/cygwin/cygthread.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/cygthread.cc b/winsup/cygwin/cygthread.cc
index b0aea36..e747a2d 100644
--- a/winsup/cygwin/cygthread.cc
+++ b/winsup/cygwin/cygthread.cc
@@ -41,7 +41,7 @@ cygthread::callfunc (bool issimplestub)
{
/* Wait for main thread to assign 'h' */
while (!h)
- low_priority_sleep (0);
+ yield ();
if (ev)
CloseHandle (ev);
ev = h;
@@ -196,7 +196,7 @@ cygthread::cygthread (LPTHREAD_START_ROUTINE start, size_t n, void *param,
if (ev)
ResetEvent (ev);
while (!thread_sync)
- low_priority_sleep (0);
+ yield ();
SetEvent (thread_sync);
thread_printf ("activated name '%s', thread_sync %p for thread %p", name, thread_sync, id);
htobe = h;
@@ -217,7 +217,7 @@ cygthread::cygthread (LPTHREAD_START_ROUTINE start, size_t n, void *param,
if (n)
{
while (!ev)
- low_priority_sleep (0);
+ yield ();
WaitForSingleObject (ev, INFINITE);
ResetEvent (ev);
}
@@ -256,7 +256,7 @@ cygthread::operator
HANDLE ()
{
while (!ev)
- low_priority_sleep (0);
+ yield ();
return ev;
}
@@ -287,7 +287,7 @@ cygthread::terminate_thread ()
bool terminated = true;
debug_printf ("thread '%s', id %p, inuse %d, stack_ptr %p", __name, id, inuse, stack_ptr);
while (inuse && !stack_ptr)
- low_priority_sleep (0);
+ yield ();
if (!inuse)
goto force_notterminated;