Makes a counted (non‐dummy, non‐alias) keep‐alive referring to executor.

Synopsis

Declared in <folly/Executor.h>

template<typename ExecutorT>
static
KeepAlive<ExecutorT>
makeKeepAlive(ExecutorT* executor);

Description

This is the sole origin of a reference‐counting keep‐alive: every such keep‐alive is either made here or moved from one that was, so tracing the acquire here ‐‐ rather than in the individual ExecutorKeepAlive constructors, all of which funnel through getKeepAliveToken() ‐‐ pairs one acquire with the one release in reset(). The captured stack still names the original caller, since the constructors are simply further up the same stack.

Return Value

A counted keep‐alive referring to executor.

Parameters

Name

Description

executor

The executor to make a keep‐alive for.

Created with MrDocs