MCPcopy Index your code
hub / github.com/BoltsFramework/Bolts-Java / trySetResult

Method trySetResult

Bolts/src/bolts/Task.java:585–596  ·  view source on GitHub ↗

Sets the result on the Task if the Task hasn't already been completed.

(TResult result)

Source from the content-addressed store, hash-verified

583 * Sets the result on the Task if the Task hasn't already been completed.
584 */
585 public boolean trySetResult(TResult result) {
586 synchronized (lock) {
587 if (complete) {
588 return false;
589 }
590 complete = true;
591 Task.this.result = result;
592 lock.notifyAll();
593 runContinuations();
594 return true;
595 }
596 }
597
598 /**
599 * Sets the error on the Task if the Task hasn't already been completed.

Callers 1

setResultMethod · 0.95

Calls 1

runContinuationsMethod · 0.80

Tested by

no test coverage detected