Skip to content

Commit

Permalink
Replacement of ThreadHints.onSpinWait by Thread.
Browse files Browse the repository at this point in the history
The ThreadHints class in Agrona has been deprecated and
all call to ThreadHints.onSpinWait have been replaced by
Thread.onSpinWait.
  • Loading branch information
pveentjer committed Jan 14, 2025
1 parent cd224ec commit e4d59ba
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1916,6 +1916,11 @@ private void initLogMetadata(
{
final UnsafeBuffer logMetaData = rawLog.metaData();

System.out.println("SessionId: " + sessionId +
" streamId:" + streamId +
" initialTermId:" + initialTermId +
" mtuLength:" + mtuLength);

defaultDataHeader
.sessionId(sessionId)
.streamId(streamId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.agrona.SystemUtil;
import org.agrona.concurrent.HighResolutionTimer;
import org.agrona.concurrent.SigInt;
import org.agrona.hints.ThreadHints;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -139,7 +138,7 @@ private static void measureRoundTrip(
{
break;
}
ThreadHints.onSpinWait();
Thread.onSpinWait();
}

final long receivedSequenceNumber = buffer.getLong(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.agrona.SystemUtil;
import org.agrona.concurrent.HighResolutionTimer;
import org.agrona.concurrent.SigInt;
import org.agrona.hints.ThreadHints;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -88,7 +87,7 @@ public static void main(final String[] args) throws IOException
boolean available = false;
while (!available)
{
ThreadHints.onSpinWait();
Thread.onSpinWait();
if (!running.get())
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.agrona.SystemUtil;
import org.agrona.concurrent.HighResolutionTimer;
import org.agrona.concurrent.SigInt;
import org.agrona.hints.ThreadHints;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -79,7 +78,7 @@ public static void main(final String[] args) throws IOException
boolean available = false;
while (!available)
{
ThreadHints.onSpinWait();
Thread.onSpinWait();
if (!running.get())
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import org.agrona.SystemUtil;
import org.agrona.concurrent.HighResolutionTimer;
import org.agrona.concurrent.SigInt;
import org.agrona.hints.ThreadHints;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -107,7 +106,7 @@ public static void main(final String[] args) throws IOException
return;
}

ThreadHints.onSpinWait();
Thread.onSpinWait();
}

final Set<SelectionKey> selectedKeys = selector.selectedKeys();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.agrona.SystemUtil;
import org.agrona.concurrent.HighResolutionTimer;
import org.agrona.concurrent.SigInt;
import org.agrona.hints.ThreadHints;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -119,7 +118,7 @@ private static void measureRoundTrip(
boolean available = false;
while (!available)
{
ThreadHints.onSpinWait();
Thread.onSpinWait();
if (!running.get())
{
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
import org.agrona.collections.MutableLong;
import org.agrona.concurrent.HighResolutionTimer;
import org.agrona.concurrent.SigInt;
import org.agrona.hints.ThreadHints;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -145,7 +144,7 @@ private static void measureRoundTrip(
return;
}

ThreadHints.onSpinWait();
Thread.onSpinWait();
}

final Set<SelectionKey> selectedKeys = selector.selectedKeys();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import org.agrona.SystemUtil;
import org.agrona.concurrent.HighResolutionTimer;
import org.agrona.concurrent.SigInt;
import org.agrona.hints.ThreadHints;

import java.io.IOException;
import java.net.InetSocketAddress;
Expand Down Expand Up @@ -111,7 +110,7 @@ private static void measureRoundTrip(
boolean available = false;
while (!available)
{
ThreadHints.onSpinWait();
Thread.onSpinWait();
if (!running.get())
{
return;
Expand Down

0 comments on commit e4d59ba

Please sign in to comment.