#include <thd.h>
Definition at line 43 of file thd.h.
◆ ThreadState
The thread states are as follows: FAKE – just a phony placeholder Thread created by the default constructor ALIVE – an actual thread of control exists associated with this thread STARTED – the thread of control has been started DONE – the thread of control has completed and been joined FAILED – the thread of control never came alive MOVED – contents were moved out and we're no longer tracking them
Enumerator |
---|
FAKE | |
ALIVE | |
STARTED | |
DONE | |
FAILED | |
MOVED | |
Definition at line 163 of file thd.h.
◆ Thread() [1/4]
grpc_core::Thread::Thread |
( |
| ) |
|
|
inline |
Default constructor only to allow use in structs that lack constructors Does not produce a validly-constructed thread; must later use placement new to construct a real thread. Does not init mu_ and cv_
Definition at line 78 of file thd.h.
◆ Thread() [2/4]
grpc_core::Thread::Thread |
( |
const char * |
thd_name, |
|
|
void(*)(void *arg) |
thd_body, |
|
|
void * |
arg, |
|
|
bool * |
success = nullptr , |
|
|
const Options & |
options = Options() |
|
) |
| |
Normal constructor to create a thread with name thd_name, which will execute a thread based on function thd_body with argument arg once it is started. The optional success argument indicates whether the thread is successfully created. The optional options can be used to set the thread detachable.
◆ Thread() [3/4]
grpc_core::Thread::Thread |
( |
Thread && |
other | ) |
|
|
inlinenoexcept |
Move constructor for thread. After this is called, the other thread no longer represents a living thread object
Definition at line 91 of file thd.h.
◆ ~Thread()
grpc_core::Thread::~Thread |
( |
| ) |
|
|
inline |
The destructor is strictly optional; either the thread never came to life and the constructor itself killed it, or it has already been joined and the Join function kills it, or it was detached (non-joinable) and it has run to completion and is now killing itself. The destructor shouldn't have to do anything.
Definition at line 123 of file thd.h.
◆ Thread() [4/4]
◆ Join()
void grpc_core::Thread::Join |
( |
| ) |
|
|
inline |
◆ operator=() [1/2]
◆ operator=() [2/2]
Move assignment operator for thread. After this is called, the other thread no longer represents a living thread object. Not allowed if this thread actually exists
Definition at line 101 of file thd.h.
◆ Start()
void grpc_core::Thread::Start |
( |
| ) |
|
|
inline |
◆ impl_
◆ options_
Options grpc_core::Thread::options_ |
|
private |
◆ state_
The documentation for this class was generated from the following file: