diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | thread.c | 12 |
2 files changed, 15 insertions, 1 deletions
@@ -1,3 +1,7 @@ +Sun May 1 01:06:24 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> + + * thread.c (rb_thread_select): release GVL while waiting select(). + Sat Apr 30 23:10:15 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com> * win32/win32.c (rb_w32_fdcopy): New. This can copy even though @@ -2672,7 +2672,17 @@ rb_thread_select(int max, fd_set * read, fd_set * write, fd_set * except, return 0; } else { - return select(max, read, write, except, timeout); + int lerrno; + int result; + + BLOCKING_REGION({ + result = select(max, read, write, except, timeout); + if (result < 0) + lerrno = errno; + }, ubf_select, GET_THREAD()); + errno = lerrno; + + return result; } } |