diff options
author | Christopher Faylor <me@cgf.cx> | 2010-03-12 23:13:48 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2010-03-12 23:13:48 +0000 |
commit | 084ea5108e86738a09288268b186541b0c23920a (patch) | |
tree | 93ad21c3c750fe12e7792ff8679b87888992dc3d /winsup/cygwin/gendef | |
parent | 36960dec3721fccc8eb931787a2656cf715bfc39 (diff) | |
download | cygnal-084ea5108e86738a09288268b186541b0c23920a.tar.gz cygnal-084ea5108e86738a09288268b186541b0c23920a.tar.bz2 cygnal-084ea5108e86738a09288268b186541b0c23920a.zip |
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/gendef')
-rwxr-xr-x | winsup/cygwin/gendef | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef index 9c17010b4..8899e8576 100755 --- a/winsup/cygwin/gendef +++ b/winsup/cygwin/gendef @@ -126,8 +126,7 @@ __sigfe: movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock testl %eax,%eax # it will be zero jz 2f # if so - xorl %eax,%eax # nope. It was not zero - call _low_priority_sleep # should be a short-time thing, so + call _yield # should be a short-time thing, so jmp 1b # sleep and loop 2: movl \$4,%eax # have the lock, now increment the xadd %eax,$tls::stackptr(%ebx) # stack pointer and get pointer @@ -151,8 +150,7 @@ __sigbe: # return here after cygwin syscall movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock testl %eax,%eax # it will be zero jz 2f # if so - xorl %eax,%eax # nope. not zero - call _low_priority_sleep # sleep + call _yield # sleep jmp 1b # and loop 2: movl \$-4,%eax # now decrement aux stack xadd %eax,$tls::stackptr(%ebx) # and get pointer @@ -177,8 +175,7 @@ _sigreturn: movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock testl %eax,%eax # it will be zero jz 2f # if so - xorl %eax,%eax # nope. not zero - call _low_priority_sleep # sleep + call _yield # sleep jmp 1b # and loop 2: popl %edx # saved errno testl %edx,%edx # Is it < 0 @@ -258,8 +255,7 @@ __ZN7_cygtls4lockEv: lock xchgl %eax,$tls::pstacklock(%ebx) testl %eax,%eax jz 2f - xorl %eax,%eax - call _low_priority_sleep + call _yield jmp 1b 2: popl %ebx ret @@ -283,8 +279,7 @@ stabilize_sig_stack: movl %eax,$tls::spinning(%ebx) # flag if we are waiting for lock testl %eax,%eax jz 2f - xorl %eax,%eax - call _low_priority_sleep + call _yield jmp 1b 2: cmpl \$0,$tls::sig(%ebx) jz 3f |