Skip to content

Commit

Permalink
Added MarkFile.timestampRelease (#318)
Browse files Browse the repository at this point in the history
This method is a replacement for the timestampOrdered. The ordered
methods use an old naming schema and the release methods use the
new naming schema.

There is a slight performance penalty because the timestampOrdered
calls the timestampRelease method.
  • Loading branch information
pveentjer authored Feb 2, 2025
1 parent 844aa8d commit 98f5ebc
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions agrona/src/main/java/org/agrona/MarkFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,22 @@ public int versionWeak()

/**
* Set timestamp field using an ordered put.
* <p>
* This method is identical to {@link #timestampRelease(long)} and that method is preferred.
*
* @param timestamp to be set.
*/
public void timestampOrdered(final long timestamp)
{
timestampRelease(timestamp);
}

/**
* Set timestamp field using a release put.
*
* @param timestamp to be set.
*/
public void timestampRelease(final long timestamp)
{
buffer.putLongRelease(timestampFieldOffset, timestamp);
}
Expand Down

0 comments on commit 98f5ebc

Please sign in to comment.