Search code examples
c++linuxerror-handlingx11xlib

Is handler set via XSetErrorHandler global or threadlocal?


If I set error handler using xlib function XSetErrorHandler will this handler work for the whole process or only for a thread where XSetErrorHandler was called?


Solution

  • It should work for the whole process. It is not good for more than 1 thread to communicate with Xlib, because Xlib is not thread-safe.