Skip to content

Commit 64dda9d

Browse files
author
Rob Austin
committed
https://github.com/ChronicleEnterprise/Chronicle-Services/issues/8 - public static AffinityLock acquireLock(int cpuId)
1 parent 99d26a3 commit 64dda9d

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

affinity/src/main/java/net/openhft/affinity/AffinityLock.java

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)