Skip to content

Commit 5baf067

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 624ff54 + 5246b3c commit 5baf067

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

affinity-test/pom.xml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>net.openhft</groupId>
2222
<artifactId>java-parent-pom</artifactId>
23-
<version>1.1.16</version>
23+
<version>1.1.22</version>
2424
<relativePath />
2525
</parent>
2626

@@ -42,7 +42,7 @@
4242
<groupId>net.openhft</groupId>
4343
<artifactId>third-party-bom</artifactId>
4444
<type>pom</type>
45-
<version>3.6.5</version>
45+
<version>3.6.9</version>
4646
<scope>import</scope>
4747
</dependency>
4848
<dependency>
@@ -125,7 +125,6 @@
125125
<plugin>
126126
<groupId>org.apache.maven.plugins</groupId>
127127
<artifactId>maven-compiler-plugin</artifactId>
128-
<version>3.6.2</version>
129128
<configuration>
130129
<compilerArgument>-Xlint:deprecation</compilerArgument>
131130
<source>1.8</source>

affinity/pom.xml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@
2020
<parent>
2121
<groupId>net.openhft</groupId>
2222
<artifactId>java-parent-pom</artifactId>
23-
<version>1.1.16</version>
24-
<relativePath />
23+
<version>1.1.22</version>
2524
</parent>
2625

2726
<modelVersion>4.0.0</modelVersion>
@@ -43,7 +42,7 @@
4342
<groupId>net.openhft</groupId>
4443
<artifactId>third-party-bom</artifactId>
4544
<type>pom</type>
46-
<version>3.6.5</version>
45+
<version>3.6.9</version>
4746
<scope>import</scope>
4847
</dependency>
4948
</dependencies>
@@ -90,11 +89,10 @@
9089
<plugin>
9190
<groupId>org.apache.maven.plugins</groupId>
9291
<artifactId>maven-compiler-plugin</artifactId>
93-
<version>3.6.2</version>
9492
<configuration>
9593
<compilerArgument>-Xlint:deprecation</compilerArgument>
96-
<source>1.7</source>
97-
<target>1.7</target>
94+
<source>1.8</source>
95+
<target>1.8</target>
9896
<encoding>UTF-8</encoding>
9997
</configuration>
10098
</plugin>

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,7 @@ public final synchronized void set(CpuLayout cpuLayout) {
8383
for (int i = 0; i < cpuLayout.cpus(); i++) {
8484
final boolean base = AffinityLock.BASE_AFFINITY.get(i);
8585
final boolean reservable = AffinityLock.RESERVED_AFFINITY.get(i);
86-
87-
LOGGER.trace("cpu " + i + " base={} reservable= {}", i, base, reservable);
86+
LOGGER.trace("cpu {} base={} reservable= {}", i, base, reservable);
8887
AffinityLock lock = logicalCoreLocks[i] = newLock(i, base, reservable);
8988

9089
int layoutId = lock.cpuId();
@@ -213,4 +212,4 @@ private void releaseAffinityLock(final Thread t, final AffinityLock al, final St
213212

214213
LockCheck.releaseLock(al.cpuId());
215214
}
216-
}
215+
}

affinity/src/main/java/net/openhft/affinity/impl/LinuxHelper.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,11 @@ cpu_set_t sched_getaffinity() {
6666
return cpuset;
6767
}
6868

69-
public static void sched_setaffinity(final BitSet affinity) {
69+
public static void sched_setaffinity(final BitSet affinity) {
70+
sched_setaffinity(0, affinity);
71+
}
72+
73+
public static void sched_setaffinity(final int pid, final BitSet affinity) {
7074
final CLibrary lib = CLibrary.INSTANCE;
7175
final cpu_set_t cpuset = new cpu_set_t();
7276
final int size = version.isSameOrNewer(VERSION_2_6) ? cpu_set_t.SIZE_OF_CPU_SET_T : NativeLong.SIZE;
@@ -80,12 +84,12 @@ public static void sched_setaffinity(final BitSet affinity) {
8084
}
8185
}
8286
try {
83-
if (lib.sched_setaffinity(0, size, cpuset) != 0) {
84-
throw new IllegalStateException("sched_setaffinity(0, " + size +
87+
if (lib.sched_setaffinity(pid, size, cpuset) != 0) {
88+
throw new IllegalStateException("sched_setaffinity(" + pid + ", " + size +
8589
", 0x" + Utilities.toHexString(affinity) + ") failed; errno=" + Native.getLastError());
8690
}
8791
} catch (LastErrorException e) {
88-
throw new IllegalStateException("sched_setaffinity(0, " + size +
92+
throw new IllegalStateException("sched_setaffinity(" + pid + ", " + size +
8993
", 0x" + Utilities.toHexString(affinity) + ") failed; errno=" + e.getErrorCode(), e);
9094
}
9195
}

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
<parent>
2121
<groupId>net.openhft</groupId>
2222
<artifactId>root-parent-pom</artifactId>
23-
<version>1.1.12</version>
23+
<version>1.2.1</version>
2424
<relativePath />
2525
</parent>
2626

0 commit comments

Comments
 (0)