mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* configure.in: don't force getcontext on IA64.
* eval.c (ruby_setjmp): add an argument for just before getcontext. (THREAD_SAVE_CONTEXT): call rb_thread_save_context just before getcontext. [ruby-dev:28205] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9797 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1669ac380e
commit
842b4d7d9a
3 changed files with 17 additions and 7 deletions
|
@ -1,3 +1,12 @@
|
|||
Fri Jan 6 02:20:18 2006 Tanaka Akira <akr@m17n.org>
|
||||
|
||||
* configure.in: don't force getcontext on IA64.
|
||||
|
||||
* eval.c (ruby_setjmp): add an argument for just before getcontext.
|
||||
(THREAD_SAVE_CONTEXT): call rb_thread_save_context just
|
||||
before getcontext.
|
||||
[ruby-dev:28205]
|
||||
|
||||
Sun Jan 1 15:28:46 2006 Tanaka Akira <akr@m17n.org>
|
||||
|
||||
* missing.h (isinf): avoid macro expansion
|
||||
|
|
|
@ -781,7 +781,7 @@ if test x"$enable_pthread" = xyes; then
|
|||
fi
|
||||
fi
|
||||
if test x"$ac_cv_header_ucontext_h" = xyes; then
|
||||
if test x"$target_cpu" = xia64 -o x"$rb_with_pthread" = xyes; then
|
||||
if test x"$rb_with_pthread" = xyes; then
|
||||
AC_CHECK_FUNCS(getcontext setcontext)
|
||||
fi
|
||||
fi
|
||||
|
|
13
eval.c
13
eval.c
|
@ -158,17 +158,18 @@ int function_call_may_return_twice_false = 0;
|
|||
#define FUNCTION_CALL_MAY_RETURN_TWICE 0
|
||||
#endif
|
||||
#define ruby_longjmp(env, val) rb_jump_context(env, val)
|
||||
#define ruby_setjmp(j) ((j)->status = 0, \
|
||||
#define ruby_setjmp(just_before_setjmp, j) ((j)->status = 0, \
|
||||
(just_before_setjmp), \
|
||||
FUNCTION_CALL_MAY_RETURN_TWICE, \
|
||||
getcontext(&(j)->context), \
|
||||
(j)->status)
|
||||
#else
|
||||
typedef jmp_buf rb_jmpbuf_t;
|
||||
#if !defined(setjmp) && defined(HAVE__SETJMP)
|
||||
#define ruby_setjmp(env) _setjmp(env)
|
||||
#define ruby_setjmp(just_before_setjmp, env) ((just_before_setjmp), _setjmp(env))
|
||||
#define ruby_longjmp(env,val) _longjmp(env,val)
|
||||
#else
|
||||
#define ruby_setjmp(env) setjmp(env)
|
||||
#define ruby_setjmp(just_before_setjmp, env) ((just_before_setjmp), setjmp(env))
|
||||
#define ruby_longjmp(env,val) longjmp(env,val)
|
||||
#endif
|
||||
#endif
|
||||
|
@ -918,7 +919,7 @@ static struct tag *prot_tag;
|
|||
#define PROT_YIELD INT2FIX(3) /* 7 */
|
||||
#define PROT_TOP INT2FIX(4) /* 9 */
|
||||
|
||||
#define EXEC_TAG() (FLUSH_REGISTER_WINDOWS, ruby_setjmp(prot_tag->buf))
|
||||
#define EXEC_TAG() (FLUSH_REGISTER_WINDOWS, ruby_setjmp(0, prot_tag->buf))
|
||||
|
||||
#define JUMP_TAG(st) do { \
|
||||
ruby_frame = prot_tag->frame; \
|
||||
|
@ -10123,6 +10124,7 @@ rb_thread_save_context(rb_thread_t th)
|
|||
th->bstr_max = len;
|
||||
}
|
||||
th->bstr_len = len;
|
||||
rb_ia64_flushrs();
|
||||
MEMCPY(th->bstr_ptr, th->bstr_pos, VALUE, th->bstr_len);
|
||||
#endif
|
||||
#ifdef SAVE_WIN32_EXCEPTION_LIST
|
||||
|
@ -10196,8 +10198,7 @@ rb_thread_switch(int n)
|
|||
}
|
||||
|
||||
#define THREAD_SAVE_CONTEXT(th) \
|
||||
(rb_thread_save_context(th),\
|
||||
rb_thread_switch((FLUSH_REGISTER_WINDOWS, ruby_setjmp((th)->context))))
|
||||
(rb_thread_switch((FLUSH_REGISTER_WINDOWS, ruby_setjmp(rb_thread_save_context(th), (th)->context))))
|
||||
|
||||
NORETURN(static void rb_thread_restore_context(rb_thread_t,int));
|
||||
NORETURN(NOINLINE(static void rb_thread_restore_context_0(rb_thread_t,int,void*)));
|
||||
|
|
Loading…
Reference in a new issue