Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
2.0
-
None
Description
There's a bug in DefaultFileMonitor that causes the monitor thread to sleep twice if getChecksPerRun() > 0. DefaultFileMonitor.checksPerRun defaults to 1000.
In the main loop:
for (int iterFileNames = 0; iterFileNames < fileNames.length; iterFileNames++) { // do some stuff if (getChecksPerRun() > 0) { if ((iterFileNames % getChecksPerRun()) == 0) { try { Thread.sleep(getDelay()); } catch (InterruptedException e) { // Woke up. } } } // do more stuff }
and then at the end of the loop block:
try { Thread.sleep(getDelay()); } catch (InterruptedException e) { continue; }
Workaround is to call setChecksPerRun(0).
Attachments
Attachments
Issue Links
- is related to
-
VFS-62 [vfs] [PATCH] Added modulus based delay to DefaultFileMonitor for better performance when monitoring large number of files
- Closed