diff options
author | Keith Packard <keithp@keithp.com> | 2015-12-08 14:39:46 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2016-05-26 16:07:54 -0700 |
commit | 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 (patch) | |
tree | 1643ea974c60cefb7dbd6d646e40d77263babaa3 /os | |
parent | 8cf832c288dec13cbf3c25478a8ccef52d61f3db (diff) |
Remove SIGIO support for input [v5]
This removes all of the SIGIO handling support used for input
throughout the X server, preparing the way for using threads for input
handling instead.
Places calling OsBlockSIGIO and OsReleaseSIGIO are marked with calls
to stub functions input_lock/input_unlock so that we don't lose this
information.
xfree86 SIGIO support is reworked to use internal versions of
OsBlockSIGIO and OsReleaseSIGIO.
v2: Don't change locking order (Peter Hutterer)
v3: Comment weird && FALSE in xf86Helper.c
Leave errno save/restore in xf86ReadInput
Squash with stub adding patch (Peter Hutterer)
v4: Leave UseSIGIO config parameter so that
existing config files don't break (Peter Hutterer)
v5: Split a couple of independent patch bits out
of kinput.c (Peter Hutterer)
Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'os')
-rw-r--r-- | os/utils.c | 55 |
1 files changed, 3 insertions, 52 deletions
diff --git a/os/utils.c b/os/utils.c index e48d9f856..db875c148 100644 --- a/os/utils.c +++ b/os/utils.c @@ -1304,9 +1304,7 @@ OsBlockSignals(void) if (BlockedSignalCount++ == 0) { sigset_t set; -#ifdef SIGIO - OsBlockSIGIO(); -#endif + input_lock(); sigemptyset(&set); sigaddset(&set, SIGALRM); sigaddset(&set, SIGVTALRM); @@ -1322,57 +1320,13 @@ OsBlockSignals(void) #endif } -#ifdef SIG_BLOCK -static sig_atomic_t sigio_blocked; -static sigset_t PreviousSigIOMask; -#endif - -/** - * returns zero if this call caused SIGIO to be blocked now, non-zero if it - * was already blocked by a previous call to this function. - */ -int -OsBlockSIGIO(void) -{ -#ifdef SIGIO -#ifdef SIG_BLOCK - if (sigio_blocked++ == 0) { - sigset_t set; - int ret; - - sigemptyset(&set); - sigaddset(&set, SIGIO); - sigprocmask(SIG_BLOCK, &set, &PreviousSigIOMask); - ret = sigismember(&PreviousSigIOMask, SIGIO); - return ret; - } -#endif -#endif - return 1; -} - -void -OsReleaseSIGIO(void) -{ -#ifdef SIGIO -#ifdef SIG_BLOCK - if (--sigio_blocked == 0) { - sigprocmask(SIG_SETMASK, &PreviousSigIOMask, 0); - } else if (sigio_blocked < 0) { - BUG_WARN(sigio_blocked < 0); - sigio_blocked = 0; - } -#endif -#endif -} - void OsReleaseSignals(void) { #ifdef SIG_BLOCK if (--BlockedSignalCount == 0) { sigprocmask(SIG_SETMASK, &PreviousSignalMask, 0); - OsReleaseSIGIO(); + input_unlock(); } #endif } @@ -1383,10 +1337,7 @@ OsResetSignals(void) #ifdef SIG_BLOCK while (BlockedSignalCount > 0) OsReleaseSignals(); -#ifdef SIGIO - while (sigio_blocked > 0) - OsReleaseSIGIO(); -#endif + input_force_unlock(); #endif } |