Skip to content

Commit 642d99a

Browse files
Christian Eskensurybala
Christian Esken
authored andcommitted
SPY-190: Remove the no-operation isInterrupted() call. Document interruption policy.
Motivation ---------- Avoid confusion. Make the interruption policy more clear. Modifications ------------- Remove the no-operation isInterrupted() call. Document interruption policy. Result ------ Better understandable concurrency code. Change-Id: Iaf63f8a246c45e9ed9ebfe9c4239043cbe9e2039 Reviewed-on: http://review.couchbase.org/58266 Reviewed-by: Michael Nitschinger <[email protected]> Tested-by: Michael Nitschinger <[email protected]>
1 parent ad77a2a commit 642d99a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/main/java/net/spy/memcached/internal/OperationFuture.java

+6-2
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ public void setCas(long inCas) {
207207
/**
208208
* Get the CAS for this operation.
209209
*
210+
* The interrupted status of the current thread is cleared by this method.
211+
* Inspect the returned OperationStatus to check whether an interruption has taken place.
212+
*
210213
* @throws UnsupportedOperationException If this is for an ASCII protocol
211214
* configured client.
212215
* @return the CAS for this operation or null if unsuccessful.
@@ -218,7 +221,6 @@ public Long getCas() {
218221
get();
219222
} catch (InterruptedException e) {
220223
status = new OperationStatus(false, "Interrupted", StatusCode.INTERRUPTED);
221-
Thread.currentThread().isInterrupted();
222224
} catch (ExecutionException e) {
223225
getLogger().warn("Error getting cas of operation", e);
224226
}
@@ -235,6 +237,9 @@ public Long getCas() {
235237
* Note that the operation status may change as the operation is tried and
236238
* potentially retried against the servers specified by the NodeLocator.
237239
*
240+
* The interrupted status of the current thread is cleared by this method.
241+
* Inspect the returned OperationStatus to check whether an interruption has taken place.
242+
*
238243
* @return OperationStatus
239244
*/
240245
public OperationStatus getStatus() {
@@ -243,7 +248,6 @@ public OperationStatus getStatus() {
243248
get();
244249
} catch (InterruptedException e) {
245250
status = new OperationStatus(false, "Interrupted", StatusCode.INTERRUPTED);
246-
Thread.currentThread().isInterrupted();
247251
} catch (ExecutionException e) {
248252
getLogger().warn("Error getting status of operation", e);
249253
}

0 commit comments

Comments
 (0)