summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@gmail.com>2016-01-28 16:40:02 -0500
committerKOSAKI Motohiro <kosaki.motohiro@gmail.com>2016-01-28 17:46:40 -0500
commit8dfefe2091bc901dc5deeb4bea74a0670703ac78 (patch)
tree6b80e0bf7e0f1f6985dee1cac661f521ae34c3f4
parentbfe273f1181bfc601413ed5fba731eb64f18c3b4 (diff)
downloadruby-thread_inspect.tar.gz
* thread.c (rb_thread_inspect): display @wait_for field if thethread_inspect
target thread is waiting for a mutex.
-rw-r--r--ChangeLog5
-rw-r--r--thread.c6
2 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a19c17f6c3..18133b3642 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jan 29 06:40:02 2016 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
+
+ * thread.c (rb_thread_inspect): display @wait_for field if the
+ target thread is waiting for a mutex.
+
Thu Jan 28 01:01:20 2016 KOSAKI Motohiro <kosaki.motohiro@gmail.com>
* thread.c (rb_thread_inspect): make human readable.
diff --git a/thread.c b/thread.c
index 8d078e7443..f61db9e931 100644
--- a/thread.c
+++ b/thread.c
@@ -2833,7 +2833,11 @@ rb_thread_inspect(VALUE thread)
rb_gc_force_recycle(loc);
}
}
- rb_str_catf(str, ", @status=%s>", status);
+ rb_str_catf(str, ", @status=%s", status);
+ if (th->locking_mutex != Qfalse) {
+ rb_str_catf(str, ", @wait_for=%"PRIsVALUE, rb_inspect(th->locking_mutex));
+ }
+ rb_str_catf(str, ">");
OBJ_INFECT(str, thread);
return str;