File tree Expand file tree Collapse file tree
affinity/src/main/java/net/openhft/affinity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -153,16 +153,16 @@ public static BitSet getAffinity() {
153153 return AFFINITY_IMPL .getAffinity ();
154154 }
155155
156- public static void setAffinity (final BitSet affinity ) {
157- AFFINITY_IMPL .setAffinity (affinity );
158- }
159-
160156 public static void setAffinity (int cpu ) {
161157 BitSet affinity = new BitSet (Runtime .getRuntime ().availableProcessors ());
162158 affinity .set (cpu );
163159 setAffinity (affinity );
164160 }
165161
162+ public static void setAffinity (final BitSet affinity ) {
163+ AFFINITY_IMPL .setAffinity (affinity );
164+ }
165+
166166 public static int getCpu () {
167167 return AFFINITY_IMPL .getCpu ();
168168 }
@@ -215,4 +215,8 @@ private static boolean isNonForkingAffinityAvailable() {
215215 BootClassPath bootClassPath = BootClassPath .INSTANCE ;
216216 return bootClassPath .has ("java.lang.ThreadTrackingGroup" ) && bootClassPath .has ("java.lang.ThreadLifecycleListener" );
217217 }
218+
219+ public static void resetToBaseAffinity () {
220+ Affinity .setAffinity (AffinityLock .BASE_AFFINITY );
221+ }
218222}
Original file line number Diff line number Diff line change @@ -185,10 +185,6 @@ public static String dumpLocks() {
185185 return LOCK_INVENTORY .dumpLocks ();
186186 }
187187
188- public static void main (String [] args ) {
189- System .out .println ("Test" );
190- }
191-
192188 private static boolean areAssertionsEnabled () {
193189 boolean debug = false ;
194190 assert debug = true ;
Original file line number Diff line number Diff line change @@ -161,7 +161,7 @@ public final synchronized void release() {
161161 al .boundHere = null ;
162162 }
163163 }
164- Affinity .setAffinity ( AffinityLock . BASE_AFFINITY );
164+ Affinity .resetToBaseAffinity ( );
165165 }
166166
167167 public final synchronized String dumpLocks () {
You can’t perform that action at this time.
0 commit comments