1
0
Fork 0
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:
卜部昌平 2019-08-26 15:53:57 +09:00
parent bc3e7924bc
commit e3fc30564e
4 changed files with 5 additions and 5 deletions

View file

@ -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);

View file

@ -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);
} }

View file

@ -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();

View file

@ -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;