+2015-10-23 Corinna Vinschen <corinna@vinschen.de>
+
+ * cygtls.cc (_cygtls::remove): Call remove_pending_sigs.
+ * cygtls.h (_cygtls::remove_pending_sigs): Declare.
+ * sigproc.cc (pending_signals::clear): Define new method taking a
+ _cygtls pointer argument. Drop pending signals for that thread.
+ (_cygtls::remove_pending_sigs): Call pending_signals::clear for this
+ thread.
+
2015-10-22 Corinna Vinschen <corinna@vinschen.de>
* common.din (aligned_alloc): Export.
/* FIXME: Need some sort of atthreadexit function to allow things like
select to control this themselves. */
+ remove_pending_sigs ();
if (signal_arrived)
{
HANDLE h = signal_arrived;
void handle_SIGCONT ();
private:
void __reg3 call2 (DWORD (*) (void *, void *), void *, void *);
+ void remove_pending_sigs ();
/*gentls_offsets*/
};
#pragma pack(pop)
void add (sigpacket&);
bool pending () {retry = true; return !!start.next;}
void clear (int sig) {sigs[sig].si.si_signo = 0;}
- friend void __reg1 sig_dispatch_pending (bool);;
+ void clear (_cygtls *tls);
+ friend void __reg1 sig_dispatch_pending (bool);
friend void WINAPI wait_sig (VOID *arg);
friend void sigproc_init ();
};
sigq.clear (sig);
}
+/* Clear pending signals of specific thread. Called from
+ _cygtls::remove_pending_sigs. */
+void
+pending_signals::clear (_cygtls *tls)
+{
+ for (int sig = 0; sig < NSIG + 1; ++sig)
+ if (sigs[sig].sigtls == tls)
+ clear (sig);
+}
+
+/* Clear pending signals of specific thread. Called from _cygtls::remove */
+void
+_cygtls::remove_pending_sigs ()
+{
+ sigq.clear (this);
+}
+
extern "C" int
sigpending (sigset_t *mask)
{