folly::NamedThreadFactory

A ThreadFactory that names each thread it creates.

Synopsis

Declared in <folly/executors/thread_factory/NamedThreadFactory.h>

class NamedThreadFactory
    : public ThreadFactory

Description

Threads are named by joining a shared prefix with a monotonically increasing suffix, so each thread gets a distinct, recognizable name.

Base Classes

NameDescription
ThreadFactoryInterface for creating threads used by executors.

Member Functions

NameDescription
NamedThreadFactory [constructor]Construct a factory that names threads using the given prefix.
getNamePrefix [virtual]Return the current thread name prefix.
newThread [virtual]Create a new thread that runs the given function under a generated name.
setNamePrefix Change the prefix used to name threads created after this call.

Protected Data Members

NameDescription
prefix_ The name prefix shared by every thread this factory creates.
suffix_ The next numeric suffix appended to a thread name.