  	    }
  	}
      }
-@@ -4404,6 +4435,7 @@ set_trace_func(int argc, VALUE *argv)
-     }
+@@ -4404,6 +4435,7 @@
+     rb_remove_event_hook(call_trace_func);
  
      if (NIL_P(trace)) {
 +	GET_THREAD()->exec_event_tracing = 0;
  	GET_THREAD()->tracing = EVENT_RUNNING_NOTHING;
  	return Qnil;
      }
-@@ -4592,6 +4592,67 @@ thread_suppress_tracing(rb_thread_t *th, int ev, VALUE (*func)(VALUE, int), VALU
+@@ -4461,6 +4493,7 @@ thread_suppress_tracing(rb_thread_t *th, int ev, VALUE (*func)(VALUE, int), VALU
+     rb_threadptr_remove_event_hook(th, call_trace_func);
+ 
+     if (NIL_P(trace)) {
++	GET_THREAD()->exec_event_tracing = 0;
+ 	th->tracing = EVENT_RUNNING_NOTHING;
+ 	return Qnil;
+     }
+@@ -4592,6 +4625,67 @@
      return result;
  }
  

Adds per-thread tracing by adding methods Thread#tracing? and Thread#tracing=

The basic mechanism of per-tracing thread was already inside. This
just exposes the ability the set or query thread tracing individually
by adding a couple of methods.

diff --git a/thread.c b/thread.c
index 2cf1064..69e6daa 100644

 /*
  *  call-seq:
  *     thr.backtrace    -> array
@@ -4713,6 +4807,14 @@ Init_Thread(void)
     rb_define_method(rb_cThread, "set_trace_func", thread_set_trace_func_m, 1);
     rb_define_method(rb_cThread, "add_trace_func", thread_add_trace_func_m, 1);
 
