Skip to content

Commit

Permalink
Make isPublished method as deprecated.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeb01 committed Sep 27, 2017
1 parent 990e8fe commit 2a66a1d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/main/java/com/lmax/disruptor/RingBuffer.java
Original file line number Diff line number Diff line change
Expand Up @@ -336,11 +336,16 @@ public E claimAndGetPreallocated(long sequence)
}

/**
* Determines if a particular entry has been published.
* Determines if a particular entry is available. Note that using this when not within a context that is
* maintaining a sequence barrier, it is likely that using this to determine if you can read a value is likely
* to result in a race condition and broken code.
*
* @param sequence The sequence to identify the entry.
* @return If the value has been published or not.
* @return If the value can be read or not.
* @deprecated Please don't use this method. It probably won't
* do what you think that it does.
*/
@Deprecated
public boolean isPublished(long sequence)
{
return sequencer.isAvailable(sequence);
Expand Down

0 comments on commit 2a66a1d

Please sign in to comment.