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 1b12249fd6
)
This commit is contained in:
parent
04c72d3c30
commit
b5c98aa677
|
@ -722,6 +722,7 @@ extern _X_HIDDEN void input_constrain_cursor(DeviceIntPtr pDev, ScreenPtr screen
|
||||||
extern _X_EXPORT void input_lock(void);
|
extern _X_EXPORT void input_lock(void);
|
||||||
extern _X_EXPORT void input_unlock(void);
|
extern _X_EXPORT void input_unlock(void);
|
||||||
extern _X_EXPORT void input_force_unlock(void);
|
extern _X_EXPORT void input_force_unlock(void);
|
||||||
|
extern _X_EXPORT int in_input_thread(void);
|
||||||
|
|
||||||
extern void InputThreadPreInit(void);
|
extern void InputThreadPreInit(void);
|
||||||
extern void InputThreadInit(void);
|
extern void InputThreadInit(void);
|
||||||
|
|
|
@ -90,6 +90,13 @@ static pthread_mutex_t input_mutex;
|
||||||
static Bool input_mutex_initialized;
|
static Bool input_mutex_initialized;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
int
|
||||||
|
in_input_thread(void)
|
||||||
|
{
|
||||||
|
return inputThreadInfo &&
|
||||||
|
pthread_equal(pthread_self(), inputThreadInfo->thread);
|
||||||
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
input_lock(void)
|
input_lock(void)
|
||||||
{
|
{
|
||||||
|
@ -529,6 +536,7 @@ void input_force_unlock(void) {}
|
||||||
void InputThreadPreInit(void) {}
|
void InputThreadPreInit(void) {}
|
||||||
void InputThreadInit(void) {}
|
void InputThreadInit(void) {}
|
||||||
void InputThreadFini(void) {}
|
void InputThreadFini(void) {}
|
||||||
|
int in_input_thread(void) { return 0; }
|
||||||
|
|
||||||
int InputThreadRegisterDev(int fd,
|
int InputThreadRegisterDev(int fd,
|
||||||
NotifyFdProcPtr readInputProc,
|
NotifyFdProcPtr readInputProc,
|
||||||
|
|
3
os/io.c
3
os/io.c
|
@ -652,6 +652,9 @@ WriteToClient(ClientPtr who, int count, const void *__buf)
|
||||||
int padBytes;
|
int padBytes;
|
||||||
const char *buf = __buf;
|
const char *buf = __buf;
|
||||||
|
|
||||||
|
BUG_RETURN_VAL_MSG(in_input_thread(), 0,
|
||||||
|
"******** %s called from input thread *********\n", __func__);
|
||||||
|
|
||||||
#ifdef DEBUG_COMMUNICATION
|
#ifdef DEBUG_COMMUNICATION
|
||||||
Bool multicount = FALSE;
|
Bool multicount = FALSE;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue
Block a user