A ThreadFactory that names each thread it creates.
Declared in <folly/executors/thread_factory/NamedThreadFactory.h>
class NamedThreadFactory
: public ThreadFactory
Threads are named by joining a shared prefix with a monotonically increasing suffix, so each thread gets a distinct, recognizable name.
| Name | Description |
|---|---|
ThreadFactory | Interface for creating threads used by executors. |
| 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. |
| Name | Description |
|---|---|
prefix_ | The name prefix shared by every thread this factory creates. |
suffix_ | The next numeric suffix appended to a thread name. |