* thread_pthread.c: make native_fd_select().

* thread.c (do_select): remove #ifdef _WIN32. Instead, use
  native_fd_select() always.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33346 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
kosaki 2011-09-27 00:59:04 +00:00
Родитель 2cc5eeaf6c
Коммит 1bdf1a5c6f
3 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Tue Sep 27 09:55:40 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread_pthread.c: make native_fd_select().
* thread.c (do_select): remove #ifdef _WIN32. Instead, use
native_fd_select() always.
Tue Sep 27 09:44:59 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c (do_select): remove cygwin specific hack. It's layer

Просмотреть файл

@ -2529,6 +2529,7 @@ do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except,
rb_fdset_t UNINITIALIZED_VAR(orig_except);
double limit = 0;
struct timeval wait_rest;
rb_thread_t *th = GET_THREAD();
if (timeout) {
limit = timeofday();
@ -2547,21 +2548,10 @@ do_select(int n, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except,
retry:
lerrno = 0;
#if defined(_WIN32)
{
rb_thread_t *th = GET_THREAD();
BLOCKING_REGION({
BLOCKING_REGION({
result = native_fd_select(n, read, write, except, timeout, th);
if (result < 0) lerrno = errno;
}, ubf_select, th);
}
#else
BLOCKING_REGION({
result = rb_fd_select(n, read, write, except, timeout);
if (result < 0) lerrno = errno;
}, ubf_select, GET_THREAD());
#endif
errno = lerrno;
if (result < 0) {

Просмотреть файл

@ -856,6 +856,12 @@ native_thread_apply_priority(rb_thread_t *th)
#endif /* USE_NATIVE_THREAD_PRIORITY */
static int
native_fd_select(int n, rb_fdset_t *readfds, rb_fdset_t *writefds, rb_fdset_t *exceptfds, struct timeval *timeout, rb_thread_t *th)
{
return rb_fd_select(n, readfds, writefds, exceptfds, timeout);
}
static void
ubf_pthread_cond_signal(void *ptr)
{