summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mjit.c2
-rw-r--r--thread_pthread.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/mjit.c b/mjit.c
index 5632f633db..a02a020507 100644
--- a/mjit.c
+++ b/mjit.c
@@ -1198,7 +1198,7 @@ mjit_init(struct mjit_options *opts)
/* Initialize worker thread */
finish_worker_p = FALSE;
worker_finished = FALSE;
- if (rb_thread_create_mjit_thread(child_after_fork, (void *)worker) == FALSE) {
+ if (!rb_thread_create_mjit_thread(child_after_fork, worker)) {
mjit_init_p = FALSE;
rb_native_mutex_destroy(&mjit_engine_mutex);
rb_native_cond_destroy(&mjit_pch_wakeup);
diff --git a/thread_pthread.c b/thread_pthread.c
index 1a6cf0c768..3735283c28 100644
--- a/thread_pthread.c
+++ b/thread_pthread.c
@@ -1791,7 +1791,7 @@ mjit_worker(void *arg)
/* Launch MJIT thread. Returns FALSE if it fails to create thread. */
int
-rb_thread_create_mjit_thread(void (*child_hook)(void), void *worker_func)
+rb_thread_create_mjit_thread(void (*child_hook)(void), void (*worker_func)(void))
{
pthread_attr_t attr;
pthread_t worker_pid;
@@ -1799,7 +1799,7 @@ rb_thread_create_mjit_thread(void (*child_hook)(void), void *worker_func)
pthread_atfork(NULL, NULL, child_hook);
if (pthread_attr_init(&attr) == 0
&& pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM) == 0
- && pthread_create(&worker_pid, &attr, mjit_worker, worker_func) == 0) {
+ && pthread_create(&worker_pid, &attr, mjit_worker, (void *)worker_func) == 0) {
/* jit_worker thread is not to be joined */
pthread_detach(worker_pid);
return TRUE;