mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
remove rb_postponed_job_t::th
.
* vm_trace.c (rb_postponed_job_t): remove `th` field because it is not used. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f3482ddabf
commit
001eb22c75
1 changed files with 9 additions and 11 deletions
20
vm_trace.c
20
vm_trace.c
|
@ -1500,7 +1500,6 @@ Init_vm_trace(void)
|
||||||
|
|
||||||
typedef struct rb_postponed_job_struct {
|
typedef struct rb_postponed_job_struct {
|
||||||
unsigned long flags; /* reserved */
|
unsigned long flags; /* reserved */
|
||||||
struct rb_thread_struct *th; /* created thread, reserved */
|
|
||||||
rb_postponed_job_func_t func;
|
rb_postponed_job_func_t func;
|
||||||
void *data;
|
void *data;
|
||||||
} rb_postponed_job_t;
|
} rb_postponed_job_t;
|
||||||
|
@ -1523,7 +1522,7 @@ enum postponed_job_register_result {
|
||||||
};
|
};
|
||||||
|
|
||||||
static enum postponed_job_register_result
|
static enum postponed_job_register_result
|
||||||
postponed_job_register(rb_thread_t *th, rb_vm_t *vm,
|
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, int max, int expected_index)
|
||||||
{
|
{
|
||||||
rb_postponed_job_t *pjob;
|
rb_postponed_job_t *pjob;
|
||||||
|
@ -1538,11 +1537,10 @@ postponed_job_register(rb_thread_t *th, rb_vm_t *vm,
|
||||||
}
|
}
|
||||||
|
|
||||||
pjob->flags = flags;
|
pjob->flags = flags;
|
||||||
pjob->th = th;
|
|
||||||
pjob->func = func;
|
pjob->func = func;
|
||||||
pjob->data = data;
|
pjob->data = data;
|
||||||
|
|
||||||
RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th->ec);
|
RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec);
|
||||||
|
|
||||||
return PJRR_SUCESS;
|
return PJRR_SUCESS;
|
||||||
}
|
}
|
||||||
|
@ -1552,11 +1550,11 @@ postponed_job_register(rb_thread_t *th, rb_vm_t *vm,
|
||||||
int
|
int
|
||||||
rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data)
|
rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void *data)
|
||||||
{
|
{
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_execution_context_t *ec = GET_EC();
|
||||||
rb_vm_t *vm = th->vm;
|
rb_vm_t *vm = rb_ec_vm_ptr(ec);
|
||||||
|
|
||||||
begin:
|
begin:
|
||||||
switch (postponed_job_register(th, vm, flags, func, data, MAX_POSTPONED_JOB, vm->postponed_job_index)) {
|
switch (postponed_job_register(ec, vm, flags, func, data, MAX_POSTPONED_JOB, vm->postponed_job_index)) {
|
||||||
case PJRR_SUCESS : return 1;
|
case PJRR_SUCESS : return 1;
|
||||||
case PJRR_FULL : return 0;
|
case PJRR_FULL : return 0;
|
||||||
case PJRR_INTERRUPTED: goto begin;
|
case PJRR_INTERRUPTED: goto begin;
|
||||||
|
@ -1568,8 +1566,8 @@ rb_postponed_job_register(unsigned int flags, rb_postponed_job_func_t func, void
|
||||||
int
|
int
|
||||||
rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data)
|
rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func, void *data)
|
||||||
{
|
{
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_execution_context_t *ec = GET_EC();
|
||||||
rb_vm_t *vm = th->vm;
|
rb_vm_t *vm = rb_ec_vm_ptr(ec);
|
||||||
rb_postponed_job_t *pjob;
|
rb_postponed_job_t *pjob;
|
||||||
int i, index;
|
int i, index;
|
||||||
|
|
||||||
|
@ -1578,11 +1576,11 @@ rb_postponed_job_register_one(unsigned int flags, rb_postponed_job_func_t func,
|
||||||
for (i=0; i<index; i++) {
|
for (i=0; i<index; i++) {
|
||||||
pjob = &vm->postponed_job_buffer[i];
|
pjob = &vm->postponed_job_buffer[i];
|
||||||
if (pjob->func == func) {
|
if (pjob->func == func) {
|
||||||
RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(th->ec);
|
RUBY_VM_SET_POSTPONED_JOB_INTERRUPT(ec);
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
switch (postponed_job_register(th, vm, flags, func, data, MAX_POSTPONED_JOB + MAX_POSTPONED_JOB_SPECIAL_ADDITION, index)) {
|
switch (postponed_job_register(ec, vm, flags, func, data, MAX_POSTPONED_JOB + MAX_POSTPONED_JOB_SPECIAL_ADDITION, index)) {
|
||||||
case PJRR_SUCESS : return 1;
|
case PJRR_SUCESS : return 1;
|
||||||
case PJRR_FULL : return 0;
|
case PJRR_FULL : return 0;
|
||||||
case PJRR_INTERRUPTED: goto begin;
|
case PJRR_INTERRUPTED: goto begin;
|
||||||
|
|
Loading…
Add table
Reference in a new issue