xcb: Clarify the XInitThreads error message

XInitThreads has been called if _Xglobal_lock != NULL, we may as well
check that before printing a misleading error message.

Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
Adam Jackson 2022-03-22 14:32:49 -04:00
parent 257927c51b
commit da97120f23

View file

@ -32,8 +32,12 @@
#define throw_thread_fail_assert(_message, _var) { \
fprintf(stderr, "[xcb] " _message "\n"); \
fprintf(stderr, "[xcb] Most likely this is a multi-threaded client " \
"and XInitThreads has not been called\n"); \
if (_Xglobal_lock) { \
fprintf(stderr, "[xcb] You called XInitThreads, this is not your fault\n"); \
} else { \
fprintf(stderr, "[xcb] Most likely this is a multi-threaded client " \
"and XInitThreads has not been called\n"); \
} \
xcb_fail_assert(_message, _var); \
}