1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

rename to rb_ec_set_raised().

* thread.c (rb_threadptr_set_raised): rename to rb_ec_set_raised
  and accepts `ec`


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60683 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-11-07 05:12:39 +00:00
parent d1013f2ab8
commit ee189904f0
5 changed files with 8 additions and 8 deletions

4
eval.c
View file

@ -509,7 +509,7 @@ setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE
volatile int state = 0;
EC_PUSH_TAG(ec);
if (EXEC_TAG() == TAG_NONE && !(state = rb_threadptr_set_raised(rb_ec_thread_ptr(ec)))) {
if (EXEC_TAG() == TAG_NONE && !(state = rb_ec_set_raised(ec))) {
VALUE bt = rb_get_backtrace(mesg);
if (!NIL_P(bt) || cause == Qundef) {
if (OBJ_FROZEN(mesg)) {
@ -568,7 +568,7 @@ setup_exception(rb_execution_context_t *ec, int tag, volatile VALUE mesg, VALUE
}
}
if (rb_threadptr_set_raised(rb_ec_thread_ptr(ec))) {
if (rb_ec_set_raised(ec)) {
fatal:
ec->errinfo = exception_error;
rb_ec_reset_raised(ec);

View file

@ -271,7 +271,7 @@ error_handle(int ex)
int status = EXIT_FAILURE;
rb_execution_context_t *ec = GET_EC();
if (rb_threadptr_set_raised(rb_ec_thread_ptr(ec)))
if (rb_ec_set_raised(ec))
return EXIT_FAILURE;
switch (ex & TAG_MASK) {
case 0:

View file

@ -280,11 +280,11 @@ enum {
RAISED_STACKOVERFLOW = 2,
RAISED_NOMEMORY = 4
};
int rb_threadptr_set_raised(rb_thread_t *th);
#define rb_thread_raised_set(th, f) ((th)->ec->raised_flag |= (f))
#define rb_thread_raised_reset(th, f) ((th)->ec->raised_flag &= ~(f))
#define rb_thread_raised_p(th, f) (((th)->ec->raised_flag & (f)) != 0)
#define rb_thread_raised_clear(th) ((th)->ec->raised_flag = 0)
int rb_ec_set_raised(rb_execution_context_t *ec);
int rb_ec_reset_raised(rb_execution_context_t *th);
int rb_ec_stack_check(rb_execution_context_t *ec);

View file

@ -2167,12 +2167,12 @@ rb_threadptr_signal_exit(rb_thread_t *th)
#endif
int
rb_threadptr_set_raised(rb_thread_t *th)
rb_ec_set_raised(rb_execution_context_t *ec)
{
if (th->ec->raised_flag & RAISED_EXCEPTION) {
if (ec->raised_flag & RAISED_EXCEPTION) {
return 1;
}
th->ec->raised_flag |= RAISED_EXCEPTION;
ec->raised_flag |= RAISED_EXCEPTION;
return 0;
}

View file

@ -292,7 +292,7 @@ exec_hooks_protected(rb_execution_context_t *ec, rb_hook_list_t *list, const rb_
EC_POP_TAG();
if (raised) {
rb_threadptr_set_raised(rb_ec_thread_ptr(ec));
rb_ec_set_raised(ec);
}
return state;