New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor HAS_SIGPROCMASK in Perl_despatch_signals #13558
Comments
From @bulk88Created by @bulk88I can't refactor this since this code doesn't exist on Win32. Hence this Line 1461 in fb29cc7
void
Perl_despatch_signals(pTHX)
{
dVAR;
int sig;
PL_sig_pending = 0;
for (sig = 1; sig < SIG_SIZE; sig++) {
if (PL_psig_pend[sig]) {
dSAVE_ERRNO;
#ifdef HAS_SIGPROCMASK
/* From sigaction(2) (FreeBSD man page):
* | Signal routines normally execute with the signal that
* | caused their invocation blocked, but other signals may
* | yet occur.
* Emulation of this behavior (from within Perl) is enabled
* using sigprocmask
*/
int was_blocked;
sigset_t newset, oldset;
sigemptyset(&newset);
sigaddset(&newset, sig);
sigprocmask(SIG_BLOCK, &newset, &oldset);
was_blocked = sigismember(&oldset, sig);
if (!was_blocked) {
//instead of SVs, why not Newx and SAVEFREEPV? or instead of SAVEFREEPV
put a Safefree into unblock_sigmask()?
SV* save_sv = newSVpvn((char *)(&newset), sizeof(sigset_t)); // dont
assign here
ENTER;
// save_sv = newSVpvn((char *)(&newset), // put me here
for locality.
SAVEFREESV(save_sv);
SAVEDESTRUCTOR_X(unblock_sigmask, SvPV_nolen(save_sv)); //SvPVX since
no magic and gurenteed PV, and switch from SAVEDESTRUCTOR_X to
SAVEDESTRUCTOR since my_perl isn't used in unblock_sigmask
}
--------------------------------------------------------------------
#if defined HAS_SIGPROCMASK
static void
unblock_sigmask(pTHX_ void* newset) //remove pTHX_
{
sigprocmask(SIG_UNBLOCK, (sigset_t*)newset, NULL);
}
#endif Perl Info
|
From @TuxOn Mon, 27 Jan 2014 22:45:05 -0800, bulk88 (via RT)
Triggers twitching eye: // comment are a no-go: they will break many -- |
The RT System itself - Status changed from 'new' to 'open' |
From @bulk88The // comments were so that nobody gets really lazy and commits my comments unchanged as -- |
From perl5-porters@perl.orgH.Merijn Brand wrote:
That's the point. These are to-do comments. |
From @LeontOn Tue, Jan 28, 2014 at 7:45 AM, bulk88 <perlbug-followup@perl.org> wrote:
Ehm, I don't know. Probably I was so used to using SAVEFREESV that
*Shrugs*
Is there really any advantage of SAVEDESTRUCTOR over SAVEDESTRUCTOR_X? It's Leon |
Migrated from rt.perl.org#121100 (status was 'open')
Searchable as RT121100$
The text was updated successfully, but these errors were encountered: