Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline baseline JDK methods from JDKSpecific #155

Merged
merged 1 commit into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/org/jboss/threads/EnhancedQueueExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ public Builder setKeepAliveTime(final Duration keepAliveTime) {
@Deprecated
public Builder setKeepAliveTime(final long keepAliveTime, final TimeUnit keepAliveUnits) {
Assert.checkNotNullParam("keepAliveUnits", keepAliveUnits);
return setKeepAliveTime(Duration.of(keepAliveTime, JDKSpecific.timeToTemporal(keepAliveUnits)));
return setKeepAliveTime(Duration.of(keepAliveTime, keepAliveUnits.toChronoUnit()));
}

/**
Expand Down Expand Up @@ -2248,7 +2248,7 @@ void park(EnhancedQueueExecutor enhancedQueueExecutor) {
if (spins < YIELD_FACTOR) {
Thread.yield();
} else {
JDKSpecific.onSpinWait();
Thread.onSpinWait();
}
spins--;
if (parked == STATE_UNPARKED && unsafe.compareAndSwapInt(this, parkedOffset, STATE_UNPARKED, STATE_NORMAL)) {
Expand Down Expand Up @@ -2281,7 +2281,7 @@ void park(EnhancedQueueExecutor enhancedQueueExecutor, long nanos) {
if (spins < YIELD_FACTOR) {
Thread.yield();
} else {
JDKSpecific.onSpinWait();
Thread.onSpinWait();
}
if (parked == STATE_UNPARKED && unsafe.compareAndSwapInt(this, parkedOffset, STATE_UNPARKED, STATE_NORMAL)) {
return;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jboss/threads/EnhancedViewExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ private EnhancedViewExecutorRunnable blockingTake() {
// try again
if (spins < MAX_QUEUE_SPINS) {
spins++;
JDKSpecific.onSpinWait();
Thread.onSpinWait();
} else {
Thread.yield();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/jboss/threads/JBossThread.java
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public void interrupt() {
} else if (oldVal == STATE_INTERRUPT_IN_PROGRESS) {
// wait for interruption on other thread to be completed
if (spins < MAX_INTERRUPT_SPINS) {
JDKSpecific.onSpinWait();
onSpinWait();
spins++;
} else {
Thread.yield();
Expand Down
17 changes: 0 additions & 17 deletions src/main/java/org/jboss/threads/JDKSpecific.java

This file was deleted.