diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-12-14 09:00:08 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 1998-12-14 09:00:08 +0000 |
commit | 17a5fa1b4344199cef86c2cea4f1ba35f021593d (patch) | |
tree | a85bb7fdd3bbae60a1a69b2efa898ce949f8e2ac /eval.c | |
parent | 11187ce939d94c3a2f6d9239114c2696a8271834 (diff) |
1.1c final (hopefully)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/v1_1r@347 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 46 |
1 files changed, 35 insertions, 11 deletions
@@ -385,7 +385,10 @@ static struct SCOPE *top_scope; _frame.cbase = the_frame->cbase; \ the_frame = &_frame; \ -#define POP_FRAME() the_frame = _frame.prev; } +#define POP_FRAME() \ + sourcefile = _frame.file; \ + sourceline = _frame.line; \ + the_frame = _frame.prev; } struct BLOCK { NODE *var; @@ -6256,6 +6259,34 @@ int thread_tick = THREAD_TICK; static VALUE thread_raise _((int, VALUE*, VALUE)); +#if defined(HAVE_SETITIMER) && !defined(__BOW__) +static int thread_init = 0; + +void +thread_start_timer() +{ + struct itimerval tval; + + if (!thread_init) return; + tval.it_interval.tv_sec = 0; + tval.it_interval.tv_usec = 100000; + tval.it_value = tval.it_interval; + setitimer(ITIMER_VIRTUAL, &tval, NULL); +} + +void +thread_stop_timer() +{ + struct itimerval tval; + + if (!thread_init) return; + tval.it_interval.tv_sec = 0; + tval.it_interval.tv_usec = 0; + tval.it_value = tval.it_interval; + setitimer(ITIMER_VIRTUAL, &tval, NULL); +} +#endif + VALUE thread_create(fn, arg) VALUE (*fn)(); @@ -6267,11 +6298,7 @@ thread_create(fn, arg) enum thread_status status; #if defined(HAVE_SETITIMER) && !defined(__BOW__) - static init = 0; - - if (!init) { - struct itimerval tval; - + if (!thread_init) { #ifdef POSIX_SIGNAL posix_signal(SIGVTALRM, catch_timer); posix_signal(SIGALRM, catch_timer); @@ -6280,11 +6307,8 @@ thread_create(fn, arg) signal(SIGALRM, catch_timer); #endif - tval.it_interval.tv_sec = 0; - tval.it_interval.tv_usec = 100000; - tval.it_value = tval.it_interval; - setitimer(ITIMER_VIRTUAL, &tval, NULL); - init = 1; + thread_init = 1; + thread_start_timer(); } #endif |