Skip to content

Commit

Permalink
Remove java.lang classes and NonForkingAffinityLock to support Java 1…
Browse files Browse the repository at this point in the history
…2+, Fixes #58
  • Loading branch information
nicktindall committed May 26, 2021
1 parent a73913c commit 41ed40f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 291 deletions.
45 changes: 0 additions & 45 deletions affinity/src/main/java/java/lang/ThreadLifecycleListener.java

This file was deleted.

53 changes: 0 additions & 53 deletions affinity/src/main/java/java/lang/ThreadTrackingGroup.java

This file was deleted.

13 changes: 4 additions & 9 deletions affinity/src/main/java/net/openhft/affinity/Affinity.java
Original file line number Diff line number Diff line change
Expand Up @@ -198,24 +198,19 @@ public static boolean isJNAAvailable() {
}

public static AffinityLock acquireLock() {
return isNonForkingAffinityAvailable() ? NonForkingAffinityLock.acquireLock() : AffinityLock.acquireLock();
return AffinityLock.acquireLock();
}

public static AffinityLock acquireCore() {
return isNonForkingAffinityAvailable() ? NonForkingAffinityLock.acquireCore() : AffinityLock.acquireCore();
return AffinityLock.acquireCore();
}

public static AffinityLock acquireLock(boolean bind) {
return isNonForkingAffinityAvailable() ? NonForkingAffinityLock.acquireLock(bind) : AffinityLock.acquireLock(bind);
return AffinityLock.acquireLock(bind);
}

public static AffinityLock acquireCore(boolean bind) {
return isNonForkingAffinityAvailable() ? NonForkingAffinityLock.acquireCore(bind) : AffinityLock.acquireCore(bind);
}

private static boolean isNonForkingAffinityAvailable() {
BootClassPath bootClassPath = BootClassPath.INSTANCE;
return bootClassPath.has("java.lang.ThreadTrackingGroup") && bootClassPath.has("java.lang.ThreadLifecycleListener");
return AffinityLock.acquireCore(bind);
}

public static void resetToBaseAffinity() {
Expand Down

This file was deleted.

0 comments on commit 41ed40f

Please sign in to comment.