[PATCH 2/5] os: add OsBlockSIGIO and OsReleaseSIGIO

Keith Packard keithp at keithp.com
Mon Jul 2 23:30:13 PDT 2012


Peter Hutterer <peter.hutterer at who-t.net> writes:

>  void
>  OsReleaseSignals(void)
>  {
>  #ifdef SIG_BLOCK
>      if (--BlockedSignalCount == 0) {
>          sigprocmask(SIG_SETMASK, &PreviousSignalMask, 0);
> +        OsReleaseSIGIO();
>      }
>  #endif

Should you use SIG_UNBLOCK instead of SIG_SETMASK? It took me several
minutes to figure out that SIG_SETMASK will work because
PreviousSignalMask *always* contains SIGIO as it is set after
the call to OsBlockSIGIO in OsBlockSignals. Either that, or a comment
explaining why this works so future-me doesn't get confused again...

-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20120702/f329f8fc/attachment.pgp>


More information about the xorg-devel mailing list