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 1717
1818package net .openhft .affinity ;
1919
20+ import net .openhft .affinity .impl .NullAffinity ;
2021import org .jetbrains .annotations .NotNull ;
2122import org .slf4j .Logger ;
2223import org .slf4j .LoggerFactory ;
2324
2425import java .util .NavigableMap ;
2526import java .util .TreeMap ;
2627
28+ import static net .openhft .affinity .Affinity .getAffinityImpl ;
29+
2730class LockInventory {
2831
2932 private static final Logger LOGGER = LoggerFactory .getLogger (LockInventory .class );
@@ -97,6 +100,9 @@ public final synchronized void set(CpuLayout cpuLayout) {
97100 }
98101
99102 public final synchronized AffinityLock acquireLock (boolean bind , int cpuId , AffinityStrategy ... strategies ) {
103+ if (getAffinityImpl () instanceof NullAffinity )
104+ return noLock ();
105+
100106 final boolean specificCpuRequested = !isAnyCpu (cpuId );
101107 if (specificCpuRequested && cpuId != 0 ) {
102108 final AffinityLock required = logicalCoreLocks [cpuId ];
You can’t perform that action at this time.
0 commit comments