summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
Diffstat (limited to 'dix')
-rw-r--r--dix/globals.c9
-rw-r--r--dix/main.c9
2 files changed, 14 insertions, 4 deletions
diff --git a/dix/globals.c b/dix/globals.c
index f36a938f7..e3139303f 100644
--- a/dix/globals.c
+++ b/dix/globals.c
@@ -132,3 +132,12 @@ Bool explicit_display = FALSE;
char *ConnectionInfo;
CARD32 TimeOutValue = DEFAULT_TIMEOUT * MILLI_PER_SECOND;
+
+#if DEBUG_INPUT_MUTEX
+#define INPUT_MUTEX_INITIALIZER PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP
+#else
+#define INPUT_MUTEX_INITIALIZER PTHREAD_MUTEX_INITIALIZER
+#endif
+
+pthread_mutex_t input_mutex = INPUT_MUTEX_INITIALIZER;
+__thread int input_mutex_count;
diff --git a/dix/main.c b/dix/main.c
index 77e0f2ecb..4ba43133e 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -121,12 +121,9 @@ Equipment Corporation.
extern void Dispatch(void);
#ifdef XQUARTZ
-#include <pthread.h>
-
-BOOL serverRunning = FALSE;
+BOOL serverRunning;
pthread_mutex_t serverRunningMutex = PTHREAD_MUTEX_INITIALIZER;
pthread_cond_t serverRunningCond = PTHREAD_COND_INITIALIZER;
-
#endif
CallbackListPtr RootWindowFinalizeCallback = NULL;
@@ -299,6 +296,8 @@ dix_main(int argc, char *argv[], char *envp[])
NotifyParentProcess();
+ InputThreadInit();
+
Dispatch();
#ifdef XQUARTZ
@@ -331,6 +330,8 @@ dix_main(int argc, char *argv[], char *envp[])
CloseInput();
+ InputThreadFini();
+
for (i = 0; i < screenInfo.numScreens; i++)
screenInfo.screens[i]->root = NullWindow;