MCPcopy Create free account
hub / github.com/traneio/future / compress

Method compress

future-java/src/main/java/io/trane/future/Promise.java:327–338  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

325 }
326
327 @SuppressWarnings("unchecked")
328 private final Promise<T> compress() {
329 while (true) {
330 final Object curr = state;
331 if (curr instanceof Promise && !(curr instanceof Continuation)) { // Linked
332 final Promise<T> target = ((Promise<T>) curr).compress();
333 if (curr == target || cas(curr, target))
334 return target;
335 } else
336 return this;
337 }
338 }
339
340 /**
341 * Completes this promise with value.

Callers 2

trySetStateMethod · 0.80
safeFlushMethod · 0.80

Calls 1

casMethod · 0.95

Tested by

no test coverage detected