File tree Expand file tree Collapse file tree
main/java/net/openhft/affinity
test/java/net/openhft/affinity Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -239,9 +239,9 @@ public void bind(boolean wholeCore) {
239239
240240 final boolean canReserve () {
241241
242- /* if (!LockCheck.isCpuFree(cpuId))
242+ if (!LockCheck .isCpuFree (cpuId ))
243243 return false ;
244- */
244+
245245 if (!reservable ) return false ;
246246 if (assignedThread != null ) {
247247 if (assignedThread .isAlive ()) {
Original file line number Diff line number Diff line change @@ -139,6 +139,7 @@ public void assignReleaseThread() throws IOException {
139139 assertEquals (AffinityLock .BASE_AFFINITY , Affinity .getAffinity ());
140140 }
141141
142+
142143 @ Test
143144 public void testIssue21 () throws IOException {
144145 if (!new File ("/proc/cpuinfo" ).exists ()) {
@@ -157,7 +158,8 @@ public void testIssue21() throws IOException {
157158
158159 } else {
159160 assertNotSame (alForAnotherThread , al );
160- assertNotSame (alForAnotherThread .cpuId (), al .cpuId ());
161+ if (alForAnotherThread .cpuId () != -1 )
162+ assertNotSame (alForAnotherThread .cpuId (), al .cpuId ());
161163 }
162164 alForAnotherThread .release ();
163165 al .release ();
You can’t perform that action at this time.
0 commit comments