Skip to content

Commit e1a0c25

Browse files
committed
Merge branch 'master' of https://github.com/msalvagna/Java-Thread-Affinity into solaris-getThreadId
# By Peter Lawrey # Via Peter Lawrey * 'master' of https://github.com/msalvagna/Java-Thread-Affinity: Remove blank lines at the start of methods and loops. Remove blank lines before } Remove double and triple blank lines
2 parents 9e6f3a6 + 266a509 commit e1a0c25

File tree

13 files changed

+1
-26
lines changed

13 files changed

+1
-26
lines changed

affinity-test/src/test/java/net/openhft/affinity/osgi/OSGiBundleTest.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
*/
1818
package net.openhft.affinity.osgi;
1919

20-
import org.junit.Ignore;
2120
import org.junit.Test;
2221
import org.junit.runner.RunWith;
2322
import org.ops4j.pax.exam.Configuration;
@@ -26,13 +25,11 @@
2625
import org.osgi.framework.Bundle;
2726
import org.osgi.framework.BundleContext;
2827

29-
import java.util.Dictionary;
3028
import javax.inject.Inject;
3129

3230
import static org.junit.Assert.*;
3331
import static org.ops4j.pax.exam.CoreOptions.*;
3432

35-
3633
//@Ignore
3734
@RunWith(PaxExam.class)
3835
public class OSGiBundleTest extends net.openhft.affinity.osgi.OSGiTestBase {

affinity/src/main/java/java/lang/ThreadLifecycleListener.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package java.lang;
2020

21-
2221
/**
2322
* A listener for various events in a Thread's life: creation, termination, etc.
2423
*/

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,6 @@ else if (base)
292292
}
293293

294294
public static void main(String[] args) {
295-
296295
System.out.println("Test");
297296
}
298297
}

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ public static class utsname extends Structure {
3030
"domainname"
3131
);
3232

33-
3433
/** Name of the implementation of the operating system. */
3534
public byte[] sysname = new byte[_UTSNAME_LENGTH];
3635

@@ -87,7 +86,6 @@ public String getRealeaseVersion() {
8786
break;
8887
}
8988
return release.substring(0, len);
90-
9189
}
9290

9391
public String getVersion() {
@@ -172,7 +170,6 @@ public static void __CPU_CLR(int cpu, cpu_set_t cpuset ) {
172170
public static boolean __CPU_ISSET(int cpu, cpu_set_t cpuset ) {
173171
return (cpuset.__bits[__CPUELT(cpu)].longValue() & __CPUMASK(cpu)) != 0;
174172
}
175-
176173
}
177174

178175
interface CLibrary extends Library {
@@ -267,7 +264,6 @@ public static int sched_getcpu() {
267264
}
268265
}
269266
}
270-
271267
}
272268

273269
public static int getpid() {

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
package net.openhft.affinity.impl;
22

3-
import com.sun.jna.*;
3+
import com.sun.jna.Platform;
44
import net.openhft.affinity.IAffinity;
55
import org.slf4j.Logger;
66
import org.slf4j.LoggerFactory;
77

8-
98
public enum LinuxJNAAffinity implements IAffinity {
109
INSTANCE;
1110
private static final Logger LOGGER = LoggerFactory.getLogger(LinuxJNAAffinity.class);

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package net.openhft.affinity.impl;
2020

21-
2221
import net.openhft.affinity.IAffinity;
2322
import org.slf4j.Logger;
2423
import org.slf4j.LoggerFactory;
@@ -58,5 +57,4 @@ public int getThreadId() {
5857
throw new UnsupportedOperationException();
5958
}
6059

61-
6260
}

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818

1919
package net.openhft.affinity.impl;
2020

21-
2221
import com.sun.jna.LastErrorException;
2322
import com.sun.jna.Library;
2423
import com.sun.jna.Native;
@@ -76,6 +75,5 @@ interface CLibrary extends Library {
7675
Native.loadLibrary("libpthread.dylib", CLibrary.class);
7776

7877
int pthread_self() throws LastErrorException;
79-
8078
}
8179
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ private static boolean is64Bit0() {
177177
return systemProp != null && systemProp.contains("_64");
178178
}
179179

180-
181180
/**
182181
* @author BegemoT
183182
*/

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ public class VanillaCpuLayout implements CpuLayout {
6363
}
6464
throw new AssertionError(error);
6565
}
66-
6766
}
6867

6968
@NotNull

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ public long getAffinity() {
5555
throw new IllegalStateException("GetProcessAffinityMask(( -1 ), &(" + cpuset1 + "), &(" + cpuset2 + ") ) return " + ret);
5656

5757
return cpuset1.getValue();
58-
5958
} catch (Exception e) {
6059
e.printStackTrace();
6160
}
@@ -70,7 +69,6 @@ public void setAffinity(final long affinity) {
7069
int pid = getTid();
7170
try {
7271
lib.SetThreadAffinityMask(pid, aff);
73-
7472
} catch (LastErrorException e) {
7573
throw new IllegalStateException("SetThreadAffinityMask((" + pid + ") , &(" + affinity + ") ) errorNo=" + e.getErrorCode(), e);
7674
}
@@ -81,13 +79,11 @@ public int getTid() {
8179

8280
try {
8381
return lib.GetCurrentThread();
84-
8582
} catch (LastErrorException e) {
8683
throw new IllegalStateException("GetCurrentThread( ) errorNo=" + e.getErrorCode(), e);
8784
}
8885
}
8986

90-
9187
@Override
9288
public int getCpu() {
9389
return -1;
@@ -106,7 +102,6 @@ public int getThreadId() {
106102
return tid;
107103
}
108104

109-
110105
/**
111106
* @author BegemoT
112107
*/

0 commit comments

Comments
 (0)