Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

functions TypeRegistry.shutdownFileSystemWatcherThread and FileSystemWatcher.shutdownAndWait #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1537,6 +1537,15 @@ public static boolean instanceFieldInterceptionRequired(int ids, String name) {
return false;
}

/**
* Shuts down FileSystemWatcher thread and waits until it is finished.
* @throws InterruptedException
*/
public void shutdownFileSystemWatcherThread() throws InterruptedException {
if(fsWatcher != null)
fsWatcher.shutdownAndWait();
}

/**
* Called for a field operation - trying to determine whether a particular field needs special handling.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,17 @@ public void shutdown() {
watchThread.timeToStop();
}
}

/**
* Shutdown the thread and wait until it is finished.
* @throws java.lang.InterruptedException
*/
public void shutdownAndWait() throws InterruptedException {
if (threadRunning) {
watchThread.timeToStop();
thread.join();
}
}

/**
* Add a new file to the list of those being monitored. If the file is something that can be watched, then this method will
Expand Down