I just noticed this had made it here. I pasted below a reproducer app. The thread blocks until a key is pressed.

About the patch itself, it looks like the assumption of the patch is also made on xcb_io.c, line 347, where it is more cautiously called a "reasonable claim".



#include <X11/Xlib.h>
#include <stdio.h>
#include <pthread.h>

Display* d;

void* thread(void *ptr)
{
    int actualCount;
    XListFonts(d, "", 1, &actualCount);
    printf("thread finished\n");
}

int main(void) {
   pthread_t t;
   XEvent e;
   Window w;
   int s;

   XInitThreads();

   d = XOpenDisplay(NULL);
   s = DefaultScreen(d);
   w = XCreateSimpleWindow(d, RootWindow(d, s), 10, 10, 100, 100, 1,
                           BlackPixel(d, s), WhitePixel(d, s));
   XSelectInput(d, w, KeyPressMask);
   XMapWindow(d, w);

   pthread_create( &t, NULL, thread, NULL);

   while (1) {
      XNextEvent(d, &e);
      if (e.type == KeyPress)
         break;
    }

   XCloseDisplay(d);
   printf("main finished\n");
   return 0;
}

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to