aboutsummaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/cygtls.cc4
-rw-r--r--winsup/cygwin/cygwait.cc4
-rw-r--r--winsup/cygwin/exceptions.cc24
-rw-r--r--winsup/cygwin/local_includes/cygtls.h2
-rwxr-xr-xwinsup/cygwin/scripts/gendef2
-rw-r--r--winsup/cygwin/signal.cc2
6 files changed, 20 insertions, 18 deletions
diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc
index afaee8e..2842c27 100644
--- a/winsup/cygwin/cygtls.cc
+++ b/winsup/cygwin/cygtls.cc
@@ -76,10 +76,10 @@ _cygtls::init_thread (void *x, DWORD (*func) (void *, void *))
void
_cygtls::fixup_after_fork ()
{
- if (sig)
+ if (current_sig)
{
pop ();
- sig = 0;
+ current_sig = 0;
}
stacklock = spinning = 0;
signal_arrived = NULL;
diff --git a/winsup/cygwin/cygwait.cc b/winsup/cygwin/cygwait.cc
index dbbe1db..80c0e97 100644
--- a/winsup/cygwin/cygwait.cc
+++ b/winsup/cygwin/cygwait.cc
@@ -82,9 +82,9 @@ cygwait (HANDLE object, PLARGE_INTEGER timeout, unsigned mask)
/* all set */;
else
{
- int sig = _my_tls.sig;
+ int sig = _my_tls.current_sig;
if (is_cw_sig_cont && sig == SIGCONT)
- _my_tls.sig = 0;
+ _my_tls.current_sig = 0;
if (!sig)
continue;
if (is_cw_sig_eintr || (is_cw_sig_cont && sig == SIGCONT))
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 60c1f59..3b31e65 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -891,8 +891,9 @@ sig_handle_tty_stop (int sig, siginfo_t *, void *)
sigproc_printf ("process %d stopped by signal %d", myself->pid, sig);
/* FIXME! This does nothing to suspend anything other than the main
thread. */
- /* Use special cygwait parameter to handle SIGCONT. _main_tls.sig will
- be cleared under lock when SIGCONT is detected. */
+ /* Use special cygwait parameter to handle SIGCONT.
+ _main_tls.current_sig will be cleared under lock when SIGCONT is
+ detected. */
pthread::suspend_all_except_self ();
DWORD res = cygwait (NULL, cw_infinite, cw_sig_cont);
pthread::resume_all ();
@@ -952,7 +953,8 @@ _cygtls::interrupt_setup (siginfo_t& si, void *handler, struct sigaction& siga)
}
infodata = si;
- this->sig = si.si_signo; /* Should always be last thing set to avoid race */
+ /* current_sig should always be last thing set to avoid race */
+ this->current_sig = si.si_signo;
if (incyg)
set_signal_arrived ();
@@ -976,10 +978,10 @@ sigpacket::setup_handler (void *handler, struct sigaction& siga, _cygtls *tls)
CONTEXT cx;
bool interrupted = false;
- if (tls->sig)
+ if (tls->current_sig)
{
sigproc_printf ("trying to send signal %d but signal %d already armed",
- si.si_signo, tls->sig);
+ si.si_signo, tls->current_sig);
goto out;
}
@@ -1432,14 +1434,14 @@ _cygtls::handle_SIGCONT ()
before exiting the loop. */
bool sigsent = false;
while (1)
- if (sig) /* Assume that it's ok to just test sig outside of a
+ if (current_sig) /* Assume that it's ok to just test sig outside of a
lock since setup_handler does it this way. */
yield (); /* Attempt to schedule another thread. */
else if (sigsent)
break; /* SIGCONT has been recognized by other thread */
else
{
- sig = SIGCONT;
+ current_sig = SIGCONT;
set_signal_arrived (); /* alert sig_handle_tty_stop */
sigsent = true;
}
@@ -1675,7 +1677,7 @@ _cygtls::call_signal_handler ()
while (1)
{
lock ();
- if (!sig)
+ if (!current_sig)
{
unlock ();
break;
@@ -1686,7 +1688,7 @@ _cygtls::call_signal_handler ()
if (retaddr () == (__tlsstack_t) sigdelayed)
pop ();
- debug_only_printf ("dealing with signal %d", sig);
+ debug_only_printf ("dealing with signal %d", current_sig);
this_sa_flags = sa_flags;
sigset_t this_oldmask = set_process_mask_delta ();
@@ -1699,7 +1701,7 @@ _cygtls::call_signal_handler ()
}
/* Save information locally on stack to pass to handler. */
- int thissig = sig;
+ int thissig = current_sig;
siginfo_t thissi = infodata;
void (*thisfunc) (int, siginfo_t *, void *) = func;
@@ -1768,7 +1770,7 @@ _cygtls::call_signal_handler ()
int this_errno = saved_errno;
reset_signal_arrived ();
incyg = false;
- sig = 0; /* Flag that we can accept another signal */
+ current_sig = 0; /* Flag that we can accept another signal */
unlock (); /* unlock signal stack */
/* Alternate signal stack requested for this signal and alternate signal
diff --git a/winsup/cygwin/local_includes/cygtls.h b/winsup/cygwin/local_includes/cygtls.h
index f67e913..28bbe60 100644
--- a/winsup/cygwin/local_includes/cygtls.h
+++ b/winsup/cygwin/local_includes/cygtls.h
@@ -192,7 +192,7 @@ public: /* Do NOT remove this public: line, it's a marker for gentls_offsets. */
class cygthread *_ctinfo;
class san *andreas;
waitq wq;
- int sig;
+ int current_sig;
unsigned incyg;
unsigned spinning;
unsigned stacklock;
diff --git a/winsup/cygwin/scripts/gendef b/winsup/cygwin/scripts/gendef
index 968ef2b..720325f 100755
--- a/winsup/cygwin/scripts/gendef
+++ b/winsup/cygwin/scripts/gendef
@@ -374,7 +374,7 @@ stabilize_sig_stack:
pause
jmp 1b
2: incl _cygtls.incyg(%r12)
- cmpl \$0,_cygtls.sig(%r12)
+ cmpl \$0,_cygtls.current_sig(%r12)
jz 3f
decl _cygtls.stacklock(%r12) # release lock
movq \$_cygtls.start_offset,%rcx # point to beginning
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index 9ee6cf9..a7af604 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -634,7 +634,7 @@ do_wait:
if (info)
*info = _my_tls.infodata;
res = _my_tls.infodata.si_signo;
- _my_tls.sig = 0;
+ _my_tls.current_sig = 0;
if (_my_tls.retaddr () == (__tlsstack_t) sigdelayed)
_my_tls.pop ();
_my_tls.unlock ();