def clean
      @locks.delete_if{|t|!t.alive?}
      if(@lock_owner && !@lock_owner.alive?)
        @lock_owner = @locks.empty? ? nil : @locks.shift
        @lock_owner.wakeup if @lock_owner && !owner?(Thread.current)
      end
    end
def clean
      @locks.delete_if{|t|!t.alive?}
      if(@lock_owner && !@lock_owner.alive?)
        @lock_owner = @locks.empty? ? nil : @locks.shift
        @lock_owner.wakeup if @lock_owner && !owner?(Thread.current)
      end
    end
This is a simple helper method to help keep threads from ending
 up stuck waiting for a lock when a thread locks the monitor and
 then decides to die without unlocking. It is only called when
 new locks are attempted or a check is made if the monitor is
 currently locked.