def do_unlock
      unless(owner?(Thread.current))
        raise ThreadError.new("Thread #{Thread.current} is not the current owner: #{@lock_owner}")
      end
      Thread.exclusive do
        @locks.delete_if{|t|!t.alive?}
        unless(@locks.empty?)
          old_owner = @lock_owner
          @lock_owner = @locks.shift
          @lock_owner.wakeup unless old_owner == @lock_owner
        else
          @lock_owner = nil
        end
      end
    end
def do_unlock
      unless(owner?(Thread.current))
        raise ThreadError.new("Thread #{Thread.current} is not the current owner: #{@lock_owner}")
      end
      Thread.exclusive do
        @locks.delete_if{|t|!t.alive?}
        unless(@locks.empty?)
          old_owner = @lock_owner
          @lock_owner = @locks.shift
          @lock_owner.wakeup unless old_owner == @lock_owner
        else
          @lock_owner = nil
        end
      end
    end
Unlock the monitor