Group overloaded method together.

PiperOrigin-RevId: 323806853
This commit is contained in:
samrobinson 2020-07-29 17:48:07 +01:00 committed by Oliver Woodman
parent 867d45ca62
commit d6ee5b84d3

View file

@ -292,6 +292,20 @@ public final class PlayerMessage {
return isDelivered;
}
/**
* Marks the message as processed. Should only be called by a {@link Sender} and may be called
* multiple times.
*
* @param isDelivered Whether the message has been delivered to its target. The message is
* considered as being delivered when this method has been called with {@code isDelivered} set
* to true at least once.
*/
public synchronized void markAsProcessed(boolean isDelivered) {
this.isDelivered |= isDelivered;
isProcessed = true;
notifyAll();
}
/**
* Blocks until after the message has been delivered or the player is no longer able to deliver
* the message or the specified waiting time elapses.
@ -314,20 +328,6 @@ public final class PlayerMessage {
return experimental_blockUntilDelivered(timeoutMs, Clock.DEFAULT);
}
/**
* Marks the message as processed. Should only be called by a {@link Sender} and may be called
* multiple times.
*
* @param isDelivered Whether the message has been delivered to its target. The message is
* considered as being delivered when this method has been called with {@code isDelivered} set
* to true at least once.
*/
public synchronized void markAsProcessed(boolean isDelivered) {
this.isDelivered |= isDelivered;
isProcessed = true;
notifyAll();
}
@VisibleForTesting()
/* package */ synchronized boolean experimental_blockUntilDelivered(long timeoutMs, Clock clock)
throws InterruptedException, TimeoutException {