Skip to content

Commit

Permalink
* Fix swallowed InterruptedException (issue bytedeco/javacv#315)
Browse files Browse the repository at this point in the history
  • Loading branch information
saudet committed Jan 30, 2016
1 parent 2f16e6b commit f7161d0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

* Fix swallowed `InterruptedException` ([issue bytedeco/javacv#315](https://github.com/bytedeco/javacv/issues/315))
* Adjust a few things in `Generator` preventing `@Virtual` from working properly in some cases ([issue bytedeco/javacpp-presets#143](https://github.com/bytedeco/javacpp-presets/issues/143))
* Fix `TokenIndexer` inserting an invalid token while expanding macros ending with a backslash ([issue #63](https://github.com/bytedeco/javacpp/issues/63))
* Make `Parser` take `Info.skip` into account for `enum` declarations as well
Expand Down
11 changes: 6 additions & 5 deletions src/main/java/org/bytedeco/javacpp/Loader.java
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,10 @@ public static String loadLibrary(URL[] urls, String libnameversion) {
// ... else wait until the file is at least 1 second old ...
try {
Thread.sleep(1000);
} catch (InterruptedException ex) { }
} catch (InterruptedException ex) {
// ... reset interrupt to be nice ...
Thread.currentThread().interrupt();
}
}
}
if (file != null && file.exists()) {
Expand Down Expand Up @@ -673,7 +676,7 @@ public static String loadLibrary(URL[] urls, String libnameversion) {
}

// ... that makes sure to delete all our files.
public static void main(String[] args) {
public static void main(String[] args) throws InterruptedException {
File tmpdir = new File(System.getProperty("java.io.tmpdir"));
File tempDir = new File(args[0]);
if (!tmpdir.equals(tempDir.getParentFile()) ||
Expand All @@ -683,9 +686,7 @@ public static void main(String[] args) {
}
for (File file : tempDir.listFiles()) {
while (file.exists() && !file.delete()) {
try {
Thread.sleep(100);
} catch (InterruptedException e) { }
Thread.sleep(100);
}
}
tempDir.delete();
Expand Down

0 comments on commit f7161d0

Please sign in to comment.