summaryrefslogtreecommitdiff
path: root/mi
diff options
context:
space:
mode:
authorAndy Ritger <aritger@nvidia.com>2012-06-20 11:52:34 -0700
committerAdam Jackson <ajax@redhat.com>2015-09-23 11:07:23 -0400
commitd2a6962474978437545120ebc1fcfb909d901d55 (patch)
tree38116770f7a87914f687bf5cb8a79b88ade8b398 /mi
parentcc57ab4fc8b9dc15531f0dd9f5b352fa99a80cd0 (diff)
mi: Log an error if mieqProcessInputEvents() recurses.
v2: Uses BUG_WARN_MSG to also provide a stack trace. (Peter Hutterer) Signed-off-by: Keith Packard <keithp@keithp.com> Signed-off-by: Andy Ritger <aritger@nvidia.com>
Diffstat (limited to 'mi')
-rw-r--r--mi/mieq.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/mi/mieq.c b/mi/mieq.c
index f7d8721e1..01812bdeb 100644
--- a/mi/mieq.c
+++ b/mi/mieq.c
@@ -579,11 +579,20 @@ mieqProcessInputEvents(void)
InternalEvent event;
DeviceIntPtr dev = NULL, master = NULL;
size_t n_enqueued;
+ static Bool inProcessInputEvents = FALSE;
#ifdef XQUARTZ
pthread_mutex_lock(&miEventQueueMutex);
#endif
+ /*
+ * report an error if mieqProcessInputEvents() is called recursively;
+ * this can happen, e.g., if something in the mieqProcessDeviceEvent()
+ * call chain calls UpdateCurrentTime() instead of UpdateCurrentTimeIf()
+ */
+ BUG_WARN_MSG(inProcessInputEvents, "[mi] mieqProcessInputEvents() called recursively.\n");
+ inProcessInputEvents = TRUE;
+
/* Grow our queue if we are reaching capacity: < 2 * QUEUE_RESERVED_SIZE remaining */
n_enqueued = mieqNumEnqueued(&miEventQueue);
if (n_enqueued >= (miEventQueue.nevents - (2 * QUEUE_RESERVED_SIZE)) &&
@@ -642,6 +651,9 @@ mieqProcessInputEvents(void)
pthread_mutex_lock(&miEventQueueMutex);
#endif
}
+
+ inProcessInputEvents = FALSE;
+
#ifdef XQUARTZ
pthread_mutex_unlock(&miEventQueueMutex);
#endif