XtToolkitThreadInitialize - initialize the toolkit for multiple threads
#include <X11/Intrinsic.h>
Boolean XtToolkitThreadInitialize(void);
If XtToolkitThreadInitialize was previously called, it returns. The application programmer must ensure that two or more threads do not simultaneously attempt to call XtToolkitThreadInitialize; the effect of this is undefined. XtToolkitThreadInitialize returns True if the host operating system has threads and the Intrinsics are thread safe.
X Toolkit Intrinsics - C Language Interface
Xlib - C Language X Interface