From 148528ecab25ccceb54da7cd395ba19d352a0ce8 Mon Sep 17 00:00:00 2001 From: Alex Shinn Date: Thu, 26 Aug 2010 20:47:53 +0900 Subject: [PATCH] was updating sexp_context_timeout for wrong context in sexp_insert_timed --- lib/srfi/18/threads.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/srfi/18/threads.c b/lib/srfi/18/threads.c index eb6e98d3..ba8ca316 100644 --- a/lib/srfi/18/threads.c +++ b/lib/srfi/18/threads.c @@ -97,22 +97,22 @@ static void sexp_insert_timed (sexp ctx, sexp thread, sexp timeout) { #endif sexp ls1=SEXP_NULL, ls2=sexp_global(ctx, SEXP_G_THREADS_PAUSED); if (sexp_integerp(timeout) || sexp_flonump(timeout)) - gettimeofday(&sexp_context_timeval(ctx), NULL); + gettimeofday(&sexp_context_timeval(thread), NULL); if (sexp_integerp(timeout)) { - sexp_context_timeval(ctx).tv_sec += sexp_unbox_fixnum(timeout); + sexp_context_timeval(thread).tv_sec += sexp_unbox_fixnum(timeout); #if SEXP_USE_FLONUMS } else if (sexp_flonump(timeout)) { d = sexp_flonum_value(timeout); - sexp_context_timeval(ctx).tv_sec += trunc(d); - sexp_context_timeval(ctx).tv_usec += (d-trunc(d))*1000000; + sexp_context_timeval(thread).tv_sec += trunc(d); + sexp_context_timeval(thread).tv_usec += (d-trunc(d))*1000000; #endif } else { - sexp_context_timeval(ctx).tv_sec = 0; - sexp_context_timeval(ctx).tv_usec = 0; + sexp_context_timeval(thread).tv_sec = 0; + sexp_context_timeval(thread).tv_usec = 0; } if (sexp_numberp(timeout)) while (sexp_pairp(ls2) - && sexp_context_before(sexp_car(ls2), sexp_context_timeval(ctx))) + && sexp_context_before(sexp_car(ls2), sexp_context_timeval(thread))) ls1=ls2, ls2=sexp_cdr(ls2); else while (sexp_pairp(ls2) && sexp_context_timeval(sexp_car(ls2)).tv_sec)