summaryrefslogtreecommitdiff
path: root/vm_trace.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-01-31 16:15:28 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2020-02-06 11:46:51 +0900
commit34f8e75f9305b0da4ef1b0d4fe9ea3c3f31dcc22 (patch)
treee4309113aa1e41e4677e881260a527e761dd4a6e /vm_trace.c
parentce4ea956d24eab5089a143bba38126f2b11b55b6 (diff)
rb_vm_t::postponed_job_index shall be rb_atomic_t
Pointer to this field is passed to ATOMIC_CAS. We have to use rb_atomic_t for that purpose.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2885
Diffstat (limited to 'vm_trace.c')
-rw-r--r--vm_trace.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/vm_trace.c b/vm_trace.c
index e72c618739..f1aa35d664 100644
--- a/vm_trace.c
+++ b/vm_trace.c
@@ -1559,7 +1559,7 @@ enum postponed_job_register_result {
/* Async-signal-safe */
static enum postponed_job_register_result
postponed_job_register(rb_execution_context_t *ec, rb_vm_t *vm,
- unsigned int flags, rb_postponed_job_func_t func, void *data, int max, int expected_index)
+ unsigned int flags, rb_postponed_job_func_t func, void *data, rb_atomic_t max, rb_atomic_t expected_index)
{
rb_postponed_job_t *pjob;
@@ -1610,7 +1610,7 @@ rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func,
rb_execution_context_t *ec = GET_EC();
rb_vm_t *vm = rb_ec_vm_ptr(ec);
rb_postponed_job_t *pjob;
- int i, index;
+ rb_atomic_t i, index;
begin:
index = vm->postponed_job_index;
@@ -1673,7 +1673,7 @@ rb_postponed_job_flush(rb_vm_t *vm)
{
EC_PUSH_TAG(ec);
if (EC_EXEC_TAG() == TAG_NONE) {
- int index;
+ rb_atomic_t index;
struct rb_workqueue_job *wq_job;
while ((index = vm->postponed_job_index) > 0) {