# | Line 37 | Line 37 | public final class ContextSwitchTest { | |
---|---|---|
37 | } | |
38 | ||
39 | static final class MyThread extends Thread { | |
40 | + | |
41 | + | static { |
42 | + | // Reduce the risk of rare disastrous classloading in first call to |
43 | + | // LockSupport.park: https://bugs.openjdk.java.net/browse/JDK-8074773 |
44 | + | Class<?> ensureLoaded = LockSupport.class; |
45 | + | } |
46 | + | |
47 | volatile Thread other; | |
48 | volatile int nparks; | |
49 | ||
# | Line 56 | Line 63 | public final class ContextSwitchTest { | |
63 | LockSupport.unpark(other); | |
64 | nparks = p; | |
65 | System.out.println("parks: " + p); | |
59 | – | |
66 | } | |
67 | } | |
68 | } |
– | Removed lines |
+ | Added lines |
< | Changed lines |
> | Changed lines |