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

Name

Description

ThreadFactory

Interface for creating threads used by executors.

Member Functions

Name

Description

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

Name

Description

prefix_

The name prefix shared by every thread this factory creates.

suffix_

The next numeric suffix appended to a thread name.

Created with MrDocs