18 #ifndef ION_PORT_THREADUTILS_H_
19 #define ION_PORT_THREADUTILS_H_
21 #if defined(ION_PLATFORM_WINDOWS)
33 #if defined(ION_PLATFORM_WINDOWS)
63 #if defined(ION_PLATFORM_IOS) || defined(ION_PLATFORM_MAC) || \
64 defined(ION_PLATFORM_NACL)
168 #endif // ION_PORT_THREADUTILS_H_
size_t GetMaxThreadNameLength()
Returns the maximum length of a thread name if restricted by the platform.
bool(* ThreadFuncPtr)()
Thread types and constants.
ThreadLocalStorageKey CreateThreadLocalStorageKey()
Thread-local storage functions.
bool IsMainThread()
Returns true if the current thread is the main thread.
void YieldThread()
Causes the calling thread to relinquish the CPU if there are other threads waiting to execute...
bool JoinThread(ThreadId id)
Windows-specific public functions.
bool SetThreadLocalStorage(ThreadLocalStorageKey key, void *ptr)
Associates ptr with the thread-local storage area indicated by key.
ThreadId SpawnThreadStd(const ThreadStdFunc *func)
pthread_key_t ThreadLocalStorageKey
Defines a type that is used to access thread-local storage.
ThreadId SpawnThread(const ThreadFuncPtr func_ptr)
Platform-independent public functions.
std::function< bool()> ThreadStdFunc
bool IsThreadNamingSupported()
Thread naming functions.
pthread_t ThreadId
Defines a type that can be used to identify a thread.
bool SetThreadName(const std::string &name)
Sets the name of the current thread.
void * GetThreadLocalStorage(ThreadLocalStorageKey key)
Returns the pointer to the thread-local storage area indicated by key.
bool DeleteThreadLocalStorageKey(ThreadLocalStorageKey key)
Deletes a key returned by CreateThreadLocalStorageKey().
void SetMainThreadId(ThreadId id)
Sets the given thread ID to be considered the main thread; IsMainThread() will return true only for t...
ThreadId GetCurrentThreadId()
Thread ID functions.