mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread.c: volatile inside EXEC_TAG
* thread.c (rb_thread_io_blocking_region): assigned variables inside EXEC_TAG() should be volatile. * thread.c (rb_thread_s_handle_interrupt): ditto. * thread.c (exec_recursive): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f18951abda
commit
e6b0653406
2 changed files with 15 additions and 4 deletions
|
@ -1,3 +1,12 @@
|
|||
Wed Mar 4 00:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread.c (rb_thread_io_blocking_region): assigned variables
|
||||
inside EXEC_TAG() should be volatile.
|
||||
|
||||
* thread.c (rb_thread_s_handle_interrupt): ditto.
|
||||
|
||||
* thread.c (exec_recursive): ditto.
|
||||
|
||||
Wed Mar 4 00:29:18 2015 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||
|
||||
* tool/redmine-backporter.rb: now can specify shorten form of commands.
|
||||
|
|
10
thread.c
10
thread.c
|
@ -1386,9 +1386,9 @@ rb_thread_call_without_gvl(void *(*func)(void *data), void *data1,
|
|||
VALUE
|
||||
rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd)
|
||||
{
|
||||
VALUE val = Qundef; /* shouldn't be used */
|
||||
volatile VALUE val = Qundef; /* shouldn't be used */
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
int saved_errno = 0;
|
||||
volatile int saved_errno = 0;
|
||||
int state;
|
||||
|
||||
th->waiting_fd = fd;
|
||||
|
@ -1787,7 +1787,7 @@ rb_thread_s_handle_interrupt(VALUE self, VALUE mask_arg)
|
|||
{
|
||||
VALUE mask;
|
||||
rb_thread_t *th = GET_THREAD();
|
||||
VALUE r = Qnil;
|
||||
volatile VALUE r = Qnil;
|
||||
int state;
|
||||
|
||||
if (!rb_block_given_p()) {
|
||||
|
@ -4859,10 +4859,11 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE
|
|||
}
|
||||
}
|
||||
else {
|
||||
volatile VALUE ret = Qundef;
|
||||
recursive_push(p.list, p.objid, p.pairid);
|
||||
PUSH_TAG();
|
||||
if ((state = EXEC_TAG()) == 0) {
|
||||
result = (*func)(obj, arg, FALSE);
|
||||
ret = (*func)(obj, arg, FALSE);
|
||||
}
|
||||
POP_TAG();
|
||||
if (!recursive_pop(p.list, p.objid, p.pairid)) {
|
||||
|
@ -4872,6 +4873,7 @@ exec_recursive(VALUE (*func) (VALUE, VALUE, int), VALUE obj, VALUE pairid, VALUE
|
|||
sym, rb_thread_current());
|
||||
}
|
||||
if (state) JUMP_TAG(state);
|
||||
result = ret;
|
||||
}
|
||||
}
|
||||
*(volatile struct exec_recursive_params *)&p;
|
||||
|
|
Loading…
Reference in a new issue