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 @@ -167,6 +167,19 @@ public static AffinityLock acquireLock(boolean bind) {
167167 return acquireLock (bind , -1 , AffinityStrategies .ANY );
168168 }
169169
170+
171+ /**
172+ * Assign a cpu which can be bound to the current thread or another thread. <p> This can be used
173+ * for defining your thread layout centrally and passing the handle via dependency injection.
174+ *
175+ * @param cpuId the CPU id to bind to
176+ * @return A handle for an affinity lock.
177+ */
178+ public static AffinityLock acquireLock (int cpuId ) {
179+ return acquireLock (true , cpuId , AffinityStrategies .ANY );
180+ }
181+
182+
170183 /**
171184 * Assign a core(and all its cpus) which can be bound to the current thread or another thread.
172185 * <p> This can be used for defining your thread layout centrally and passing the handle via
You can’t perform that action at this time.
0 commit comments