File tree Expand file tree Collapse file tree
affinity/src/main/java/net/openhft/affinity/impl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -41,6 +41,18 @@ public enum WindowsJNAAffinity implements IAffinity {
4141 INSTANCE ;
4242 public static final boolean LOADED ;
4343 private static final Logger LOGGER = LoggerFactory .getLogger (WindowsJNAAffinity .class );
44+
45+ static {
46+ boolean loaded = false ;
47+ try {
48+ INSTANCE .getAffinity ();
49+ loaded = true ;
50+ } catch (UnsatisfiedLinkError e ) {
51+ LOGGER .warn ("Unable to load jna library" , e );
52+ }
53+ LOADED = loaded ;
54+ }
55+
4456 private final ThreadLocal <Integer > THREAD_ID = new ThreadLocal <>();
4557
4658 @ Override
@@ -65,7 +77,6 @@ public BitSet getAffinity() {
6577 catch (Exception e )
6678 {
6779 LOGGER .error (e .getMessage (), e );
68- e .printStackTrace ();
6980 }
7081
7182 return new BitSet ();
@@ -140,15 +151,4 @@ private interface CLibrary extends Library {
140151
141152 int GetCurrentThread () throws LastErrorException ;
142153 }
143-
144- static {
145- boolean loaded = false ;
146- try {
147- INSTANCE .getAffinity ();
148- loaded = true ;
149- } catch (UnsatisfiedLinkError e ) {
150- LOGGER .warn ("Unable to load jna library" , e );
151- }
152- LOADED = loaded ;
153- }
154154}
You can’t perform that action at this time.
0 commit comments