Calls getpid() and returns the returned value, with a thread‐safe cache in front. The cache is updated in the child after fork().
Synopsis
Declared in <folly/system/Pid.h>
pid_t
get_cached_pid();
Description
Thread‐safety: MT‐safe.
Async‐signal‐safety: The first call is AS‐unsafe but subsequent calls are AS‐safe.
Return Value
The process id of the current process.
Created with MrDocs