def stop(*args)
      @kill = true
      if(args.include?(:force) || waiting?)
        begin
          @thread.raise Wakeup.new
        rescue Wakeup
          #ignore since we are the caller
        end
        sleep(0.01)
        @thread.kill if @thread.alive?
      end
      nil
    end
def stop(*args)
      @kill = true
      if(args.include?(:force) || waiting?)
        begin
          @thread.raise Wakeup.new
        rescue Wakeup
          #ignore since we are the caller
        end
        sleep(0.01)
        @thread.kill if @thread.alive?
      end
      nil
    end
:force:: force the thread to stop
 :wait:: wait for the thread to stop
 Stop the thread