![]() |
AlexaClientSDK
3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
|
#include <WorkerThread.h>
Public Member Functions | |
WorkerThread () | |
~WorkerThread () | |
void | run (std::function< bool()> workFunc) |
void | cancel () |
std::thread::id | getThreadId () const |
Executes work on a single thread. Stays alive sleeping while there is no work to be done.
alexaClientSDK::avsCommon::utils::threading::WorkerThread::WorkerThread | ( | ) |
Construct a worker thread.
alexaClientSDK::avsCommon::utils::threading::WorkerThread::~WorkerThread | ( | ) |
Destruct a worker thread.
void alexaClientSDK::avsCommon::utils::threading::WorkerThread::cancel | ( | ) |
Cancel currently running work. If work is not running, the call has no effect.
std::thread::id alexaClientSDK::avsCommon::utils::threading::WorkerThread::getThreadId | ( | ) | const |
Return thread id.
void alexaClientSDK::avsCommon::utils::threading::WorkerThread::run | ( | std::function< bool()> | workFunc | ) |
Perform work on this worker thread until the work is complete or cancel is called.
workFunc | the work function, which shall be called repeatedly while the workFunc returns true or until cancel() is called. |
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0