Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2004-03-07 07:57:47 +0300
committerChristopher Faylor <me@cgf.cx>2004-03-07 07:57:47 +0300
commit3a1ccfc8c7e618eec1eb280a213282f1134eb2fb (patch)
treef394d22b8233c39ccb86f98b168cff560f9a7173 /winsup/cygwin/gendef
parent2942097ac20fab2d8237e9f7004cd2153b6ac0af (diff)
* fork.cc (fork_parent): Save parent pid in a temporary variable since child
could conceivably exit before function returns, rendering the child's shared memory area invalid. * cygtls.h (_cygtls::incyg): Declare new field. (_cygtls::in_exception): Define new function. * exceptions.cc (setup_handler): Remove locked flag. Use 'incyg' flag and in_exception function to determine when we're in a cygwin function. (_cygtls::call_signal_handler): Decrement incyg flag prior to calling a handler. Increment it on return. * gendef (_sigfe): Increment incyg flag. Use testl for zero testing rather than orl, for consistency. (_sigbe): Decrement incyg flag. Use testl for zero testing rather than orl, for consistency. (_cygtls::pop): Use testl for zero testing rather than orl, for consistency. (stabilize_sig_stack): Ditto.
Diffstat (limited to 'winsup/cygwin/gendef')
-rwxr-xr-xwinsup/cygwin/gendef14
1 files changed, 8 insertions, 6 deletions
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef
index a208cbe31..c126fc03f 100755
--- a/winsup/cygwin/gendef
+++ b/winsup/cygwin/gendef
@@ -95,12 +95,13 @@ __sigfe:
movl \$1,%eax # potential lock value
lock xchgl %eax,$tls::stacklock(%edx) # see if we can grab it
movl %eax,$tls::spinning(%edx) # flag if we are waiting for lock
- orl %eax,%eax # it will be zero
+ 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
jmp 1b # sleep and loop
-2: movl \$4,%eax # have the lock, now increment the
+2: incl $tls::incyg(%edx)
+ movl \$4,%eax # have the lock, now increment the
xadd %eax,$tls::stackptr(%edx) # stack pointer and get pointer
leal __sigbe,%ebx # new place to return to
xchgl %ebx,12(%esp) # exchange with real return value
@@ -120,7 +121,7 @@ __sigbe:
movl \$1,%eax # potential lock value
lock xchgl %eax,$tls::stacklock(%edx) # see if we can grab it
movl %eax,$tls::spinning(%edx) # flag if we are waiting for lock
- orl %eax,%eax # it will be zero
+ testl %eax,%eax # it will be zero
jz 2f # if so
xorl %eax,%eax # nope. not zero
call _low_priority_sleep # sleep
@@ -130,6 +131,7 @@ __sigbe:
xorl %ebx,%ebx
xchgl %ebx,-4(%eax) # get return address from signal stack
xchgl %ebx,8(%esp) # restore ebx/real return address
+ decl $tls::incyg(%edx)
decl $tls::stacklock(%edx) # release lock
popl %eax
popl %edx
@@ -145,7 +147,7 @@ _sigreturn:
movl \$1,%eax # potential lock value
lock xchgl %eax,$tls::stacklock(%edx) # see if we can grab it
movl %eax,$tls::spinning(%edx) # flag if we are waiting for lock
- orl %eax,%eax # it will be zero
+ testl %eax,%eax # it will be zero
jz 2f # if so
xorl %eax,%eax # nope. not zero
call _low_priority_sleep # sleep
@@ -220,7 +222,7 @@ __ZN7_cygtls4lockEv:
movl %eax,%edi
1: movl \$1,%eax
lock xchgl %eax,$tls::pstacklock(%edi)
- orl %eax,%eax
+ testl %eax,%eax
jz 2f
xorl %eax,%eax
call _low_priority_sleep
@@ -244,7 +246,7 @@ stabilize_sig_stack:
movl \$1,%eax
lock xchgl %eax,$tls::stacklock(%edx)
movl %eax,$tls::spinning(%edx) # flag if we are waiting for lock
- orl %eax,%eax
+ testl %eax,%eax
jz 2f
xorl %eax,%eax
call _low_priority_sleep