AUI Framework  develop
Cross-platform base for C++ UI apps
Loading...
Searching...
No Matches
AThread Class Reference

Represents a user-defined thread.

#include <AUI/Thread/AThread.h>

Member Function Documentation

> All members, including inherited

◆ current()

static const _< AAbstractThread > & AThread::current ( )
staticnodiscard
Returns
current thread.

◆ interrupt()

void AThread::interrupt ( )
overridevirtual

Raises the interruption flag of the thread. In order to check whether thread interrupted use AThread::interruptionPoint() or AAbstractThread::isInterrupted().

Reimplemented from AAbstractThread.

◆ interruptionPoint()

static void AThread::interruptionPoint ( )
static

If the interruption flag is raised for the caller thread then flag is reset and AThread::Interrupted exception is thrown, efficiently stopping the task execution and safely freeing resources with C++'s RAII feature.

async, asyncX, AThreadPool::enqueue, AUI_ENTRY handle AThread::Interrupted, so throwing AThread::Interrupted is safe.

◆ isInterrupted()

bool AThread::isInterrupted ( )
overridevirtual
Returns
true if interrupt requested for this thread.

Reimplemented from AAbstractThread.

◆ resetInterruptFlag()

void AThread::resetInterruptFlag ( )
overridevirtual

Reimplemented from AAbstractThread.

◆ setName()

static void AThread::setName ( AString name)
inlinestaticnoexcept

Sets name of the current thread for debugger.

Parameters
namenew name of the thread

◆ sleep()

static void AThread::sleep ( std::chrono::milliseconds duration)
static
Parameters
durationsleep duration.