File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
main/java/net/openhft/affinity
test/java/net/openhft/affinity Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -353,7 +353,7 @@ public AffinityLock acquireLock(AffinityStrategy... strategies) {
353353 * Release the current AffinityLock which can be discarded.
354354 */
355355 public void release () {
356- if (cpuId == ANY_CPU || ! reservable )
356+ if (cpuId == ANY_CPU )
357357 return ;
358358 // expensive if not actually used.
359359 lockInventory .release ();
Original file line number Diff line number Diff line change @@ -133,6 +133,7 @@ public void assignReleaseThread() throws IOException {
133133 System .out .println ("Cannot run affinity test as this system doesn't have a /proc/cpuinfo file" );
134134 return ;
135135 }
136+
136137 AffinityLock .cpuLayout (VanillaCpuLayout .fromCpuInfo ());
137138
138139 assertEquals (AffinityLock .BASE_AFFINITY , Affinity .getAffinity ());
@@ -229,6 +230,7 @@ public void shouldReturnLockForSpecifiedCpu() {
229230 try (final AffinityLock affinityLock = AffinityLock .acquireLock (3 )) {
230231 assertThat (affinityLock .cpuId (), is (3 ));
231232 }
233+ assertEquals (AffinityLock .BASE_AFFINITY , Affinity .getAffinity ());
232234 }
233235
234236 @ Test
You can’t perform that action at this time.
0 commit comments