diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-11 18:18:40 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-08-11 18:18:40 +0000 |
commit | 09590a73fab0000777c16e9f97dba31bb3c7126e (patch) | |
tree | f37beb3a4318e32814ef980f36ef3ccaf46cb200 /eval.c | |
parent | 0933db5a900d183f7236315fb87012bcc6188963 (diff) |
* eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the
flag before calling getcontext(2).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4370 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 21 |
1 files changed, 19 insertions, 2 deletions
@@ -7840,7 +7840,12 @@ enum thread_status { struct thread { struct thread *next, *prev; +#ifdef __ia64__ + ucontext_t context; + int context_status; +#else jmp_buf context; +#endif #ifdef SAVE_WIN32_EXCEPTION_LIST DWORD win32_exception_list; #endif @@ -8216,7 +8221,7 @@ rb_thread_save_context(th) #endif th->bstr_len = top - bot; REALLOC_N(th->bstr_ptr, VALUE, th->bstr_len); - MEMCPY(th->bstr_ptr, __libc_ia64_register_backing_store_base, VALUE, th->bstr_len); + MEMCPY(th->bstr_ptr, (VALUE*)__libc_ia64_register_backing_store_base, VALUE, th->bstr_len); } #endif #ifdef SAVE_WIN32_EXCEPTION_LIST @@ -8280,9 +8285,16 @@ rb_thread_switch(n) return 1; } -#define THREAD_SAVE_CONTEXT(th) \ +#ifdef __ia64__ +# define THREAD_SAVE_CONTEXT(th) \ + (rb_thread_save_context(th),\ + th->context_status = 0,\ + rb_thread_switch((FLUSH_REGISTER_WINDOWS, getcontext(&th->context),(th)->context_status))) +#else +# define THREAD_SAVE_CONTEXT(th) \ (rb_thread_save_context(th),\ rb_thread_switch((FLUSH_REGISTER_WINDOWS, setjmp((th)->context)))) +#endif static void rb_thread_restore_context _((rb_thread_t,int)); @@ -8360,7 +8372,12 @@ rb_thread_restore_context(th, exit) rb_backref_set(tmp->last_match); tmp->last_match = tval; +#ifdef __ia64__ + tmp->context_status = ex; + setcontext(&tmp->context); +#else longjmp(tmp->context, ex); +#endif } static void |