We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d1be99a commit 3140b78Copy full SHA for 3140b78
test/com/sun/jna/CallbacksTest.java
@@ -375,10 +375,10 @@ public void callback() {
375
for (int i = 0; i < Cleaner.MASTER_CLEANUP_INTERVAL_MS / 10 + 5 && (cbstruct.peer != 0 || refs.size() > 0); ++i) {
376
// Flush weak hash map
377
refs.size();
378
- try {
379
- Thread.sleep(Cleaner.MASTER_CLEANUP_INTERVAL_MS + 10); // Give the GC a chance to run
+ Thread.sleep(10); // Give the GC a chance to run
+ synchronized (CallbacksTest.class) { // the cbstruct.peer cleanup happens in a different thread, make sure we see it here
380
System.gc();
381
- } finally {}
+ }
382
}
383
assertEquals("Callback trampoline not freed", 0, cbstruct.peer);
384
0 commit comments