summaryrefslogtreecommitdiff
path: root/os/inputthread.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2017-02-23 10:21:49 +1000
committerAdam Jackson <ajax@redhat.com>2017-02-28 13:02:20 -0500
commitb5c98aa6779b97882246b03c5dea646bd1355991 (patch)
tree0a1b992fd6b0db2a64e732322dfa49bba352413f /os/inputthread.c
parent04c72d3c30623e360fd0bd37ed559915b93467f4 (diff)
os: log a bug whenever WriteToClient is called from the input thread
The input thread should generate events, not send them. Make it easier to find the instances where it's doing so. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com> (cherry picked from commit 1b12249fd6d4d3b566043d556503f3f625b9b4ba)
Diffstat (limited to 'os/inputthread.c')
-rw-r--r--os/inputthread.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/os/inputthread.c b/os/inputthread.c
index 8e7f2edb9..721e86312 100644
--- a/os/inputthread.c
+++ b/os/inputthread.c
@@ -90,6 +90,13 @@ static pthread_mutex_t input_mutex;
static Bool input_mutex_initialized;
#endif
+int
+in_input_thread(void)
+{
+ return inputThreadInfo &&
+ pthread_equal(pthread_self(), inputThreadInfo->thread);
+}
+
void
input_lock(void)
{
@@ -529,6 +536,7 @@ void input_force_unlock(void) {}
void InputThreadPreInit(void) {}
void InputThreadInit(void) {}
void InputThreadFini(void) {}
+int in_input_thread(void) { return 0; }
int InputThreadRegisterDev(int fd,
NotifyFdProcPtr readInputProc,