From 2d43238dc56982d3b9bdd204ba2ba7dc0b3693de Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Mon, 28 Jan 2013 19:12:18 +0100 Subject: [PATCH] Added comment on use of select(1). --- src/x11_window.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/x11_window.c b/src/x11_window.c index 6017370d..fdf875dc 100644 --- a/src/x11_window.c +++ b/src/x11_window.c @@ -1086,6 +1086,9 @@ void _glfwPlatformWaitEvents(void) XFlush(_glfw.x11.display); + // select(1) is used instead of an X function like XNextEvent, as the + // wait inside those are guarded by the mutex protecting the display + // struct, locking out other threads from using X (including GLX) if (select(fd + 1, &fds, NULL, NULL, NULL) > 0) _glfwPlatformPollEvents(); }