mirror of
https://github.com/glfw/glfw.git
synced 2025-10-04 13:46:37 +00:00
x11_window.c: select may return EINTR, needs to be retried
This commit is contained in:
parent
20ed0a15a4
commit
82a3ea6853
@ -62,6 +62,7 @@ typedef struct
|
|||||||
//
|
//
|
||||||
void selectDisplayConnection(struct timeval* timeout)
|
void selectDisplayConnection(struct timeval* timeout)
|
||||||
{
|
{
|
||||||
|
int rc;
|
||||||
fd_set fds;
|
fd_set fds;
|
||||||
const int fd = ConnectionNumber(_glfw.x11.display);
|
const int fd = ConnectionNumber(_glfw.x11.display);
|
||||||
|
|
||||||
@ -71,7 +72,9 @@ void selectDisplayConnection(struct timeval* timeout)
|
|||||||
// select(1) is used instead of an X function like XNextEvent, as the
|
// select(1) is used instead of an X function like XNextEvent, as the
|
||||||
// wait inside those are guarded by the mutex protecting the display
|
// wait inside those are guarded by the mutex protecting the display
|
||||||
// struct, locking out other threads from using X (including GLX)
|
// struct, locking out other threads from using X (including GLX)
|
||||||
select(fd + 1, &fds, NULL, NULL, timeout);
|
do {
|
||||||
|
rc = select(fd + 1, &fds, NULL, NULL, timeout);
|
||||||
|
} while (-1 == rc && EINTR == errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Returns whether the window is iconified
|
// Returns whether the window is iconified
|
||||||
|
Loading…
Reference in New Issue
Block a user