def start_timer
      @timer = Thread.new do
        begin
          until(@stop) do
            cur = []
            t = 0.0
            Thread.exclusive do
              t = @timers.values.min
              cur = @timers.dup
            end
            t = 0.0 if !t.nil? && t < 0.0
            a = 0.0
            begin
              a = Splib.sleep(t)
            rescue Wakeup
              # do nothing of importance
            ensure
              next if t.nil?
              Thread.exclusive do
                cur.each_pair do |thread, value|
                  value -= a
                  if(value <= 0.0)
                    thread.wakeup
                    @timers.delete(thread)
                  else
                    @timers[thread] = value
                  end
                end
              end
            end
          end
        rescue
          retry
        end
      end
    end
def start_timer
      @timer = Thread.new do
        begin
          until(@stop) do
            cur = []
            t = 0.0
            Thread.exclusive do
              t = @timers.values.min
              cur = @timers.dup
            end
            t = 0.0 if !t.nil? && t < 0.0
            a = 0.0
            begin
              a = Splib.sleep(t)
            rescue Wakeup
              # do nothing of importance
            ensure
              next if t.nil?
              Thread.exclusive do
                cur.each_pair do |thread, value|
                  value -= a
                  if(value <= 0.0)
                    thread.wakeup
                    @timers.delete(thread)
                  else
                    @timers[thread] = value
                  end
                end
              end
            end
          end
        rescue
          retry
        end
      end
    end
Starts the timer for waiting threads with a timeout