Throw a ThreadError exception if the current thread does’t own the monitor
# File monitor.rb, line 276 def mon_check_owner if @mon_owner != Thread.current raise ThreadError, "current thread not owner" end end
<code/>
<pre/>
<code/>and<pre/>for code samples.