mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rb_thread_create now free from ANYARGS
After 5e86b005c0
, I now think ANYARGS is
dangerous and should be extinct. This commit deletes ANYARGS from
rb_thread_create, which seems very safe to do.
This commit is contained in:
parent
bc3e7924bc
commit
e3fc30564e
4 changed files with 5 additions and 5 deletions
|
@ -474,7 +474,7 @@ VALUE rb_thread_wakeup(VALUE);
|
||||||
VALUE rb_thread_wakeup_alive(VALUE);
|
VALUE rb_thread_wakeup_alive(VALUE);
|
||||||
VALUE rb_thread_run(VALUE);
|
VALUE rb_thread_run(VALUE);
|
||||||
VALUE rb_thread_kill(VALUE);
|
VALUE rb_thread_kill(VALUE);
|
||||||
VALUE rb_thread_create(VALUE (*)(ANYARGS), void*);
|
VALUE rb_thread_create(VALUE (*)(void *), void*);
|
||||||
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
|
||||||
void rb_thread_wait_for(struct timeval);
|
void rb_thread_wait_for(struct timeval);
|
||||||
VALUE rb_thread_current(void);
|
VALUE rb_thread_current(void);
|
||||||
|
|
4
thread.c
4
thread.c
|
@ -810,7 +810,7 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start)
|
||||||
}
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
|
thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(void *))
|
||||||
{
|
{
|
||||||
rb_thread_t *th = rb_thread_ptr(thval), *current_th = GET_THREAD();
|
rb_thread_t *th = rb_thread_ptr(thval), *current_th = GET_THREAD();
|
||||||
int err;
|
int err;
|
||||||
|
@ -944,7 +944,7 @@ thread_initialize(VALUE thread, VALUE args)
|
||||||
}
|
}
|
||||||
|
|
||||||
VALUE
|
VALUE
|
||||||
rb_thread_create(VALUE (*fn)(ANYARGS), void *arg)
|
rb_thread_create(VALUE (*fn)(void *), void *arg)
|
||||||
{
|
{
|
||||||
return thread_create_core(rb_thread_alloc(rb_cThread), (VALUE)arg, fn);
|
return thread_create_core(rb_thread_alloc(rb_cThread), (VALUE)arg, fn);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2156,7 +2156,7 @@ timer_pthread_fn(void *p)
|
||||||
#endif /* UBF_TIMER_PTHREAD */
|
#endif /* UBF_TIMER_PTHREAD */
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
ubf_caller(const void *ignore)
|
ubf_caller(void *ignore)
|
||||||
{
|
{
|
||||||
rb_thread_sleep_forever();
|
rb_thread_sleep_forever();
|
||||||
|
|
||||||
|
|
|
@ -975,7 +975,7 @@ typedef struct rb_thread_struct {
|
||||||
VALUE args;
|
VALUE args;
|
||||||
} proc;
|
} proc;
|
||||||
struct {
|
struct {
|
||||||
VALUE (*func)(ANYARGS);
|
VALUE (*func)(void *);
|
||||||
void *arg;
|
void *arg;
|
||||||
} func;
|
} func;
|
||||||
} invoke_arg;
|
} invoke_arg;
|
||||||
|
|
Loading…
Reference in a new issue