+static void
+driSetBackgroundContext(void *loaderPrivate)
+{
+ struct dri2_context *pcp = (struct dri2_context *) loaderPrivate;
+ __glXSetCurrentContext(&pcp->base);
+}
+
+static GLboolean
+driIsThreadSafe(void *loaderPrivate)
+{
+ struct dri2_context *pcp = (struct dri2_context *) loaderPrivate;
+ /* Check Xlib is running in thread safe mode
+ *
+ * 'lock_fns' is the XLockDisplay function pointer of the X11 display 'dpy'.
+ * It wll be NULL if XInitThreads wasn't called.
+ */
+ return pcp->base.psc->dpy->lock_fns != NULL;
+}
+