зеркало из https://github.com/github/ruby.git
* 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
This commit is contained in:
Родитель
0933db5a90
Коммит
09590a73fa
|
@ -1,5 +1,8 @@
|
|||
Tue Aug 12 02:48:56 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (THREAD_SAVE_CONTEXT): should explicitly turn off the
|
||||
flag before calling getcontext(2).
|
||||
|
||||
* eval.c (struct thread): add member to save backing store on
|
||||
IA64. (ruby-bugs PR1086)
|
||||
|
||||
|
|
21
eval.c
21
eval.c
|
@ -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
|
||||
|
|
Загрузка…
Ссылка в новой задаче