libgui 2.01
libgui is a GUI library for the GameCube, Wii, and Wii U
 
Loading...
Searching...
No Matches
ThreadId Class Reference

A lightweight, comparable identifier for a thread - including the app's own main/original thread, which was never itself started via Thread and so has no Thread object of its own to name it. More...

#include <Thread.h>

Public Member Functions

bool operator== (const ThreadId &other) const
 
bool operator!= (const ThreadId &other) const
 

Static Public Member Functions

static ThreadId current ()
 

Protected Member Functions

 ThreadId (uintptr_t v)
 Wraps a backend-defined thread identifier; use current() instead.
 

Protected Attributes

uintptr_t id
 Backend-defined thread identifier (0 = none)
 

Detailed Description

A lightweight, comparable identifier for a thread - including the app's own main/original thread, which was never itself started via Thread and so has no Thread object of its own to name it.

Use this when code just needs to answer "is this the same thread that did X earlier?" (eg. "is this the main/GUI thread?"), not to own or join a thread.

Definition at line 112 of file Thread.h.

Constructor & Destructor Documentation

◆ ThreadId() [1/2]

ThreadId::ThreadId ( )
inline

Definition at line 115 of file Thread.h.

◆ ThreadId() [2/2]

ThreadId::ThreadId ( uintptr_t v)
inlineexplicitprotected

Wraps a backend-defined thread identifier; use current() instead.

Definition at line 127 of file Thread.h.

Member Function Documentation

◆ current()

ThreadId ThreadId::current ( )
static
Returns
an identifier for the calling thread.

Definition at line 129 of file Thread.cpp.

◆ operator!=()

bool ThreadId::operator!= ( const ThreadId & other) const
inline
Returns
true if the ids identify different threads

Definition at line 123 of file Thread.h.

◆ operator==()

bool ThreadId::operator== ( const ThreadId & other) const
inline
Returns
true if both ids identify the same thread

Definition at line 121 of file Thread.h.

Member Data Documentation

◆ id

uintptr_t ThreadId::id
protected

Backend-defined thread identifier (0 = none)

Definition at line 128 of file Thread.h.


The documentation for this class was generated from the following files: