mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread.c (do_select): remove useless ifdef. time calculation
is not heavy weight. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5201602c27
commit
4c926e9f15
2 changed files with 7 additions and 5 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Sat Apr 30 20:06:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
|
* thread.c (do_select): remove useless ifdef. time calculation
|
||||||
|
is not heavy weight.
|
||||||
|
|
||||||
Sat Apr 30 16:48:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
Sat Apr 30 16:48:36 2011 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
|
||||||
|
|
||||||
* benchmark/bm_io_select3.rb: New.
|
* benchmark/bm_io_select3.rb: New.
|
||||||
|
|
7
thread.c
7
thread.c
|
@ -2503,8 +2503,6 @@ do_select(int n, fd_set *read, fd_set *write, fd_set *except,
|
||||||
fd_set UNINITIALIZED_VAR(orig_read);
|
fd_set UNINITIALIZED_VAR(orig_read);
|
||||||
fd_set UNINITIALIZED_VAR(orig_write);
|
fd_set UNINITIALIZED_VAR(orig_write);
|
||||||
fd_set UNINITIALIZED_VAR(orig_except);
|
fd_set UNINITIALIZED_VAR(orig_except);
|
||||||
|
|
||||||
#ifndef linux
|
|
||||||
double limit = 0;
|
double limit = 0;
|
||||||
struct timeval wait_rest;
|
struct timeval wait_rest;
|
||||||
# if defined(__CYGWIN__) || defined(_WIN32)
|
# if defined(__CYGWIN__) || defined(_WIN32)
|
||||||
|
@ -2522,7 +2520,6 @@ do_select(int n, fd_set *read, fd_set *write, fd_set *except,
|
||||||
wait_rest = *timeout;
|
wait_rest = *timeout;
|
||||||
timeout = &wait_rest;
|
timeout = &wait_rest;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
if (read) orig_read = *read;
|
if (read) orig_read = *read;
|
||||||
if (write) orig_write = *write;
|
if (write) orig_write = *write;
|
||||||
|
@ -2583,7 +2580,7 @@ do_select(int n, fd_set *read, fd_set *write, fd_set *except,
|
||||||
if (read) *read = orig_read;
|
if (read) *read = orig_read;
|
||||||
if (write) *write = orig_write;
|
if (write) *write = orig_write;
|
||||||
if (except) *except = orig_except;
|
if (except) *except = orig_except;
|
||||||
#ifndef linux
|
|
||||||
if (timeout) {
|
if (timeout) {
|
||||||
double d = limit - timeofday();
|
double d = limit - timeofday();
|
||||||
|
|
||||||
|
@ -2592,7 +2589,7 @@ do_select(int n, fd_set *read, fd_set *write, fd_set *except,
|
||||||
if (wait_rest.tv_sec < 0) wait_rest.tv_sec = 0;
|
if (wait_rest.tv_sec < 0) wait_rest.tv_sec = 0;
|
||||||
if (wait_rest.tv_usec < 0) wait_rest.tv_usec = 0;
|
if (wait_rest.tv_usec < 0) wait_rest.tv_usec = 0;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
goto retry;
|
goto retry;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue