Lines Matching full:thread

1 //===--- A platform independent indirection for a thread class --*- C++ -*-===//
68 // Indicates that the detach operation performed thread cleanup.
74 // A data type to hold common thread attributes which have to be stored as
75 // thread state. Note that this is different from public attribute types like
77 // part of a thread's state. For example, the stack guard size.
79 // Thread attributes are typically stored on the stack. So, we align as required
83 // updated by one thread while the self thread is reading it. It is a tristate
85 // 1. The a thread is created in a detached state, then user code should never
90 // 2. If a thread is created in a joinable state, |detach_state| will start
91 // with the value DetachState::JOINABLE. Another thread can detach this
92 // thread before it exits. The state transitions will as follows:
94 // compare exchange to a state of DETACHED. The thread will clean
97 // conclude that the thread is EXITING and will wait until the thread
98 // exits. It will clean up the thread resources once the thread
101 void *stack; // Pointer to the thread stack
104 uintptr_t tls; // Address to the thread TLS memory
106 unsigned char owned_stack; // Indicates if the thread owns this stack memory
133 // Set the value associated with |key| for the current thread. Can be used
139 // Return the value associated with |key| for the current thread. Return
144 struct Thread {
153 constexpr Thread() : attrib(nullptr) {}
154 constexpr Thread(ThreadAttributes *attr) : attrib(attr) {}
205 // Detach a joinable thread.
211 // Wait for the thread to finish. This method can only be called
213 // 1. A detached thread is guaranteed to be running.
214 // 2. A joinable thread has not been detached or joined. As long as it has
217 // Also, only one thread can wait and expect to get woken up when the thread
224 // Return true if this thread is equal to the other thread.
225 bool operator==(const Thread &other) const;
227 // Set the name of the thread. Return the error number on error.
230 // Return the name of the thread in |name|. Return the error number of error.
234 LIBC_INLINE_VAR LIBC_THREAD_LOCAL Thread self;
243 // Return the current thread's atexit callback manager. After thread startup
244 // but before running the thread function, platform implementations should
245 // set the "atexit_callback_mgr" field of the thread's attributes to the value
249 // Call the currently registered thread specific atexit callbacks. Useful for