src/java.base/share/classes/sun/nio/fs/PollingWatchService.java
Print this page
*** 33,43 ****
import java.security.PrivilegedActionException;
import java.io.IOException;
import java.util.*;
import java.util.concurrent.*;
import com.sun.nio.file.SensitivityWatchEventModifier;
- import sun.misc.ManagedLocalsThread;
/**
* Simple WatchService implementation that uses periodic tasks to poll
* registered directories for changes. This implementation is for use on
* operating systems that do not have native file change notification support.
--- 33,42 ----
*** 57,67 ****
// TBD: Make the number of threads configurable
scheduledExecutor = Executors
.newSingleThreadScheduledExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
! Thread t = new ManagedLocalsThread(r);
t.setDaemon(true);
return t;
}});
}
--- 56,66 ----
// TBD: Make the number of threads configurable
scheduledExecutor = Executors
.newSingleThreadScheduledExecutor(new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
! Thread t = new Thread(null, r, "FileSystemWatchService", 0, false);
t.setDaemon(true);
return t;
}});
}