Thread::SigMask(3pm)
π Thread::SigMask β thread-specific signal masks, bestie π
okay so this is Thread::SigMask, a lil User Contributed Perl Documentation page (that's the manual name btw, we're in section 3pm, Perl module territory π) and it's giving "per-thread signal masks" and honestly? iconic.
β¨ VERSION β¨
This is version 0.004. tiny number, big power π
π SYNOPSIS π
use Thread::SigMask qw/sigset/;
use POSIX qw/SIG_BLOCK SIG_UNBLOCK/;
sigmask(SIG_BLOCK, $sigset);
...
sigmask(SIG_UNBLOCK, $sigset);
like literally just import sigset, grab a couple of constants from POSIX, block some stuff, unblock some stuff, done. periodt. π¦
πΈ DESCRIPTION πΈ
So what does this actually do? This module hands you per-thread signal masks. π«Ά
On non-threaded perls it's gonna be effectively the same as POSIX::sigprocmask β no cap, same thing, different day. And the interface? Works exactly the same as sigprocmask. Exactly. Not "kinda similar". Exactly. π
π FUNCTIONS π
sigmask($how, $newset, $oldset = undef)
Change and/or examine the calling process's signal mask. This uses POSIX::SigSet objects for the newset and oldset arguments β you're not passing plain old arrays here, bestie, you're passing proper objects. π
The behavior of the call is dependent on the value of how:
SIG_BLOCKβ the set of blocked signals becomes the union of the current set and the set argument. like a lil merge, they hold hands π€SIG_UNBLOCKβ the signals in set are removed from the current set of blocked signals. And yes, it is permissible to attempt to unblock a signal which is not blocked. go off, nothing's stopping you πSIG_SETMASKβ the set of blocked signals is simply set to the argument set. boom. replacement. π₯
Now for the argument tea β:
If oldset is defined, the previous value of the signal mask is stored in oldset. If newset is NULL, then the signal mask is unchanged (i.e., how is ignored) β but the current value of the signal mask is nevertheless returned in oldset (if it is not NULL). so you can just peek at the mask without touching it. main character move, honestly. π
β οΈ lowkey important:NULLnewsetmeanshowdoes literally nothing. don't come for me, that's just what it says. π
π SEE ALSO π
Signal::Maskβ the other one, go check it out, we support each other here π«Ά
π ACKNOWLEDGEMENTS π
Parts of this documentation is shamelessly stolen from POSIX and Linux' sigprocmask(2). shameless. they said it, not me. and we respect it πΈ
π AUTHOR π
Leon Timmermans <leont@cpan.org> β legend behaviour π
π COPYRIGHT AND LICENSE π
This software is copyright (c) 2010 by Leon Timmermans.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. so like, go wild, but legally. β¨
and that's the whole page, babe π this doc came to you as part of the User Contributed Perl Documentation, running under perl v5.42.3, dated 2026-08-19 β mwah, take care of your signal masks, they're delicate ππ¦π
π¦ where this page comes from
- ubuntu stonking: libthread-sigmask-perl 0.004-3build6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms