summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--eval.c6
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 00463f7d85..68ef1608b7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Apr 28 23:05:03 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * eval.c (get_ts): use readtime clock. [ruby-dev:38354]
+
+ * eval.c (rb_thread_stop_timer): clear thread_init while locking.
+
Tue Apr 28 19:10:42 2009 Kazuhiro NISHIYAMA <zn@mbf.nifty.com>
* test/test_timeout.rb: backported from 1.9.
diff --git a/eval.c b/eval.c
index a795ef138e..e39827dc01 100644
--- a/eval.c
+++ b/eval.c
@@ -12370,8 +12370,8 @@ get_ts(struct timespec *to, long ns)
{
struct timeval tv;
-#ifdef CLOCK_MONOTONIC
- if (clock_gettime(CLOCK_MONOTONIC, to) != 0)
+#ifdef CLOCK_REALTIME
+ if (clock_gettime(CLOCK_REALTIME, to) != 0)
#endif
{
gettimeofday(&tv, NULL);
@@ -12452,9 +12452,9 @@ rb_thread_stop_timer()
if (!thread_init) return;
safe_mutex_lock(&time_thread.lock);
pthread_cond_signal(&time_thread.cond);
+ thread_init = 0;
pthread_cleanup_pop(1);
pthread_join(time_thread.thread, NULL);
- thread_init = 0;
}
#elif defined(HAVE_SETITIMER)
static void