summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-15 01:44:43 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-06-15 01:44:43 +0000
commit4060211c96f5d54b551fed536779a79821d1628e (patch)
treeb65e7c15449225f955e104c3abace3469e7ba1ca /thread.c
parent6c9ffbf5b36344820f44b365925b23d85224dfdf (diff)
thread.c: fix thread_id formatting
* thread.c (debug_deadlock_check): fix format specifier for thread_id, which may not be a pointer, nor even a scalar value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/thread.c b/thread.c
index bc573e596d..1aa1c7983e 100644
--- a/thread.c
+++ b/thread.c
@@ -4861,6 +4861,9 @@ debug_deadlock_check(rb_vm_t *vm, VALUE msg)
rb_str_catf(msg, "\n%d threads, %d sleeps current:%p main thread:%p\n",
vm_living_thread_num(vm), vm->sleeper, GET_THREAD(), vm->main_thread);
list_for_each(&vm->living_threads, th, vmlt_node) {
+ rb_str_catf(msg, "* %+"PRIsVALUE"\n rb_thread_t:%p "
+ "native:%"PRI_THREAD_ID" int:%u",
+ th->self, th, thread_id_str(th), th->interrupt_flag);
if (th->locking_mutex) {
rb_mutex_t *mutex;
struct rb_thread_struct volatile *mth;
@@ -4871,23 +4874,16 @@ debug_deadlock_check(rb_vm_t *vm, VALUE msg)
mth = mutex->th;
waiting = mutex->cond_waiting;
native_mutex_unlock(&mutex->lock);
- rb_str_catf(msg, "* %+"PRIsVALUE"\n rb_thread_t:%p native:%p int:%u mutex:%p cond:%d\n",
- th->self, th, th->thread_id,
- th->interrupt_flag, mth, waiting);
- }
- else {
- rb_str_catf(msg, "* %+"PRIsVALUE"\n rb_thread_t:%p native:%p int:%u\n",
- th->self, th, th->thread_id,
- th->interrupt_flag);
+ rb_str_catf(msg, " mutex:%p cond:%d", mth, waiting);
}
{
rb_thread_list_t *list = th->join_list;
while (list) {
- rb_str_catf(msg, " depended by: tb_thread_id:%p\n", list->th);
+ rb_str_catf(msg, "\n depended by: tb_thread_id:%p", list->th);
list = list->next;
}
}
- rb_str_catf(msg, " ");
+ rb_str_catf(msg, "\n ");
rb_str_concat(msg, rb_ary_join(rb_vm_backtrace_str_ary(th, 0, 0), sep));
rb_str_catf(msg, "\n");
}