MCPcopy Index your code
hub / github.com/java-native-access/jna / waitFor

Method waitFor

test/com/sun/jna/CallbacksTest.java:68–80  ·  view source on GitHub ↗
(Thread thread)

Source from the content-addressed store, hash-verified

66 private static final int THREAD_TIMEOUT = 5000;
67
68 protected void waitFor(Thread thread) {
69 long start = System.currentTimeMillis();
70 while (thread.isAlive()) {
71 try {
72 Thread.sleep(10);
73 } catch (InterruptedException e) {
74 }
75 if (System.currentTimeMillis() - start > THREAD_TIMEOUT) {
76 fail("Timed out waiting for native thread " + thread
77 + " to detach and terminate");
78 }
79 }
80 }
81
82 public static class SmallTestStructure extends Structure {
83 public static final List<String> FIELDS = createFieldsOrder("value");

Calls 1

sleepMethod · 0.80

Tested by

no test coverage detected