method
name=
v2_4_6 -
Show latest stable
- Class:
Thread
name=(p1)public
static VALUE
rb_thread_setname(VALUE thread, VALUE name)
{
#ifdef SET_ANOTHER_THREAD_NAME
const char *s = "";
#endif
rb_thread_t *th;
GetThreadPtr(thread, th);
if (!NIL_P(name)) {
rb_encoding *enc;
StringValueCStr(name);
enc = rb_enc_get(name);
if (!rb_enc_asciicompat(enc)) {
rb_raise(rb_eArgError, "ASCII incompatible encoding (%s)",
rb_enc_name(enc));
}
name = rb_str_new_frozen(name);
#ifdef SET_ANOTHER_THREAD_NAME
s = RSTRING_PTR(name);
#endif
}
th->name = name;
#if defined(SET_ANOTHER_THREAD_NAME)
if (threadptr_initialized(th)) {
SET_ANOTHER_THREAD_NAME(th->thread_id, s);
}
#endif
return name;
} Related methods
- Instance methods
- []
- []=
- abort_on_exception
- abort_on_exception=
- add_trace_func
- alive?
- backtrace
- backtrace_locations
- exit
- group
- inspect
- join
- key?
- keys
- kill
- name
- name=
- pending_interrupt?
- priority
- priority=
- raise
- report_on_exception
- report_on_exception=
- run
- safe_level
- set_trace_func
- status
- stop?
- terminate
- thread_variable?
- thread_variable_get
- thread_variable_set
- thread_variables
- value
- wakeup
- Class methods
- DEBUG
- DEBUG=
- abort_on_exception
- abort_on_exception=
- current
- exclusive
- exit
- fork
- handle_interrupt
- kill
- list
- main
- new
- pass
- pending_interrupt?
- report_on_exception
- report_on_exception=
- start
- stop