diff options
author | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-14 18:08:40 +0000 |
---|---|---|
committer | kosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2012-12-14 18:08:40 +0000 |
commit | a24f2d99155e20833f26d9bbc1d97bb0ae31a9c4 (patch) | |
tree | b5ab0e4494c2d606028660afd717f170a6fc2dff /thread.c | |
parent | 2d2cac4b05e6bc24e1d1a40b9d1a972732fe4fc9 (diff) |
* file.c (rb_file_flock): use rb_thread_wait_for() instead of
rb_thread_polling(). When getting EAGAIN, we need to wait a
while even if no multi threading.
* thread.c (sleep_for_polling, rb_thread_polling) removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 19 |
1 files changed, 0 insertions, 19 deletions
@@ -994,15 +994,6 @@ sleep_wait_for_interrupt(rb_thread_t *th, double sleepsec,int spurious_check) sleep_timeval(th, double2timeval(sleepsec),spurious_check); } -static void -sleep_for_polling(rb_thread_t *th) -{ - struct timeval time; - time.tv_sec = 0; - time.tv_usec = 100 * 1000; /* 0.1 sec */ - sleep_timeval(th, time, 1); -} - void rb_thread_wait_for(struct timeval time) { @@ -1010,16 +1001,6 @@ rb_thread_wait_for(struct timeval time) sleep_timeval(th, time, 1); } -void -rb_thread_polling(void) -{ - if (!rb_thread_alone()) { - rb_thread_t *th = GET_THREAD(); - RUBY_VM_CHECK_INTS_BLOCKING(th); - sleep_for_polling(th); - } -} - /* * CAUTION: This function causes thread switching. * rb_thread_check_ints() check ruby's interrupts. |