* 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.
This commit is contained in:
Christopher Faylor
2004-03-07 04:57:47 +00:00
parent 2942097ac2
commit 3a1ccfc8c7
6 changed files with 95 additions and 65 deletions

View File

@@ -113,6 +113,7 @@ struct _cygtls
int sig;
unsigned stacklock;
unsigned spinning;
unsigned incyg;
__stack_t stack[TLS_STACK_SIZE];
unsigned padding[0];
@@ -126,7 +127,8 @@ struct _cygtls
void remove (DWORD);
void push (__stack_t, bool) __attribute__ ((regparm (3)));
__stack_t pop () __attribute__ ((regparm (1)));
bool isinitialized () {return initialized == CYGTLS_INITIALIZED || initialized == CYGTLS_EXCEPTION;}
bool isinitialized () const {return initialized == CYGTLS_INITIALIZED || initialized == CYGTLS_EXCEPTION;}
bool in_exception () const {return initialized == CYGTLS_EXCEPTION;}
void set_state (bool);
void reset_exception ();
bool interrupt_now (CONTEXT *, int, void *, struct sigaction&)