Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
threadutils.h File Reference
#include <pthread.h>
#include <functional>
#include <string>
Include dependency graph for threadutils.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 ion
 Copyright 2016 Google Inc.
 
 ion::port
 

Typedefs

typedef pthread_t ion::port::ThreadId
 Defines a type that can be used to identify a thread. More...
 
typedef pthread_key_t ion::port::ThreadLocalStorageKey
 Defines a type that is used to access thread-local storage. More...
 
typedef bool(* ion::port::ThreadFuncPtr )()
 Thread types and constants. More...
 
typedef std::function< bool()> ion::port::ThreadStdFunc
 

Functions

ThreadId ion::port::SpawnThread (const ThreadFuncPtr func_ptr)
 Platform-independent public functions. More...
 
ThreadId ion::port::SpawnThreadStd (const ThreadStdFunc *func)
 
bool ion::port::JoinThread (ThreadId id)
 Windows-specific public functions. More...
 
void ion::port::YieldThread ()
 Causes the calling thread to relinquish the CPU if there are other threads waiting to execute. More...
 
bool ion::port::IsThreadNamingSupported ()
 Thread naming functions. More...
 
size_t ion::port::GetMaxThreadNameLength ()
 Returns the maximum length of a thread name if restricted by the platform. More...
 
bool ion::port::SetThreadName (const std::string &name)
 Sets the name of the current thread. More...
 
ThreadId ion::port::GetCurrentThreadId ()
 Thread ID functions. More...
 
bool ion::port::IsMainThread ()
 Returns true if the current thread is the main thread. More...
 
void ion::port::SetMainThreadId (ThreadId id)
 Sets the given thread ID to be considered the main thread; IsMainThread() will return true only for this thread. More...
 
ThreadLocalStorageKey ion::port::CreateThreadLocalStorageKey ()
 Thread-local storage functions. More...
 
bool ion::port::SetThreadLocalStorage (ThreadLocalStorageKey key, void *ptr)
 Associates ptr with the thread-local storage area indicated by key. More...
 
void * ion::port::GetThreadLocalStorage (ThreadLocalStorageKey key)
 Returns the pointer to the thread-local storage area indicated by key. More...
 
bool ion::port::DeleteThreadLocalStorageKey (ThreadLocalStorageKey key)
 Deletes a key returned by CreateThreadLocalStorageKey(). More...