MCPcopy Create free account
hub / github.com/ImageEngine/cortex / cancel

Method cancel

include/IECore/Canceller.h:85–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83 }
84
85 void cancel()
86 {
87 // Store time of first cancellation. We use `compare_exchange_weak()`
88 // to avoid unwanted updates on subsequent calls.
89 std::chrono::steady_clock::rep epoch( 0 );
90 m_cancellationTime.compare_exchange_weak(
91 epoch,
92 std::chrono::steady_clock::now().time_since_epoch().count()
93 );
94 // Set cancellation flag _after_ storing time, so that
95 // `elapsedTime()` always sees a valid time.
96 m_cancelled = true;
97 }
98
99 bool cancelled() const
100 {

Callers 14

testCancelMethod · 0.95
testCancelMethod · 0.95
testCancelMethod · 0.95
testCancelMethod · 0.95
testCancelMethod · 0.95
testCancelLoadingMethod · 0.95
testCancelMethod · 0.95
testCancelMethod · 0.95
testCheckMethod · 0.95
fMethod · 0.95
raiserMethod · 0.95
testElapsedTimeMethod · 0.95

Calls

no outgoing calls

Tested by 13

testCancelMethod · 0.76
testCancelMethod · 0.76
testCancelMethod · 0.76
testCancelMethod · 0.76
testCancelMethod · 0.76
testCancelLoadingMethod · 0.76
testCancelMethod · 0.76
testCancelMethod · 0.76
testCheckMethod · 0.76
fMethod · 0.76
raiserMethod · 0.76
testElapsedTimeMethod · 0.76