summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/thread.c b/thread.c
index f80fcf6..95b022f 100644
--- a/thread.c
+++ b/thread.c
@@ -769,17 +769,18 @@ thread_initialize(VALUE thread, VALUE args)
GetThreadPtr(thread, th);
if (th->first_args) {
VALUE proc = th->first_proc, line, loc;
- const char *file;
+ VALUE file;
if (!proc || !RTEST(loc = rb_proc_location(proc))) {
rb_raise(rb_eThreadError, "already initialized thread");
}
- file = RSTRING_PTR(RARRAY_AREF(loc, 0));
+ file = RARRAY_AREF(loc, 0);
if (NIL_P(line = RARRAY_AREF(loc, 1))) {
- rb_raise(rb_eThreadError, "already initialized thread - %s",
- file);
+ rb_raise(rb_eThreadError,
+ "already initialized thread - %"PRIsVALUE, file);
}
- rb_raise(rb_eThreadError, "already initialized thread - %s:%d",
- file, NUM2INT(line));
+ rb_raise(rb_eThreadError,
+ "already initialized thread - %"PRIsVALUE":%"PRIsVALUE,
+ file, line);
}
return thread_create_core(thread, args, 0);
}