Comment 2 for bug 1241993

Revision history for this message
RaiMan (raimund-hocke) wrote : Re: [1.0.1] Region exists(..., 0) failing does not return instantly with scan rates > 1

This is my fix:

      int MaxTimePerScan = (int) (1000.0 / waitScanRate);
      int timeoutMilli = (int) timeout * 1000;
      long begin_t = (new Date()).getTime();
      do {
        long before_find = (new Date()).getTime();
        run();
        if (ifSuccessful()) {
          return true;
        } else if (timeoutMilli < MaxTimePerScan) {
          // instant return on first search failed if timeout very small or 0
          return false;
        }