MCPcopy Create free account
hub / github.com/3rdparty/libprocess / abandon

Method abandon

include/process/future.hpp:1182–1204  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1180
1181template <typename T>
1182bool Future<T>::abandon(bool propagating)
1183{
1184 bool result = false;
1185
1186 std::vector<AbandonedCallback> callbacks;
1187 synchronized (data->lock) {
1188 if (!data->abandoned &&
1189 data->state == PENDING &&
1190 (!data->associated || propagating)) {
1191 result = data->abandoned = true;
1192
1193 callbacks.swap(data->onAbandonedCallbacks);
1194 }
1195 }
1196
1197 // Invoke all callbacks. The callbacks get destroyed when we exit
1198 // from the function.
1199 if (result) {
1200 internal::run(std::move(callbacks));
1201 }
1202
1203 return result;
1204}
1205
1206
1207template <typename T>

Callers 4

~PromiseMethod · 0.80
thenMethod · 0.80
repairMethod · 0.80
afterMethod · 0.80

Calls 3

runFunction · 0.70
synchronizedFunction · 0.50
swapMethod · 0.45

Tested by

no test coverage detected