#include <ConditionVariableWrapper.h>
|
| ConditionVariableWrapper () |
| Constructor. More...
|
|
void | notifyOne () |
|
void | notifyAll () |
|
template<typename Predicate > |
void | wait (std::unique_lock< std::mutex > &lock, Predicate pred) |
|
template<typename Rep , typename Period , typename Predicate > |
bool | waitFor (std::unique_lock< std::mutex > &lock, const std::chrono::duration< Rep, Period > &rel_time, Predicate pred) |
|
template<typename Clock , typename Duration , typename Predicate > |
bool | waitUntil (std::unique_lock< std::mutex > &lock, const std::chrono::time_point< Clock, Duration > &timeout_time, Predicate pred) |
|
A wrapper around the standard std::condition_variable class that supports different power levels. Functionally it is the same as std::condition_variable.
Methods not containing a predicate param are omitted.
◆ ConditionVariableWrapper()
alexaClientSDK::avsCommon::utils::threading::ConditionVariableWrapper::ConditionVariableWrapper |
( |
| ) |
|
◆ getTag()
static std::string alexaClientSDK::avsCommon::utils::threading::ConditionVariableWrapper::getTag |
( |
| ) |
|
|
inlinestatic |
Returns the tag for logging purposes.
◆ notifyAll()
void alexaClientSDK::avsCommon::utils::threading::ConditionVariableWrapper::notifyAll |
( |
| ) |
|
◆ notifyOne()
void alexaClientSDK::avsCommon::utils::threading::ConditionVariableWrapper::notifyOne |
( |
| ) |
|
◆ wait()
template<typename Predicate >
void alexaClientSDK::avsCommon::utils::threading::ConditionVariableWrapper::wait |
( |
std::unique_lock< std::mutex > & |
lock, |
|
|
Predicate |
pred |
|
) |
| |
This function will freeze any associated thread PowerResource
on the thread, ensuring that the system may enter a lower power state upon waiting. Upon unblocking, the thread PowerResource
will be thawed.
Refer to documentation for std::condition_variable for more information on standard behavior.
- Template Parameters
-
Predicate | The predicate to evaluate. |
- Parameters
-
lock | The locked mutex. |
pred | The predicate to evaluate. |
◆ waitFor()
template<typename Rep , typename Period , typename Predicate >
bool alexaClientSDK::avsCommon::utils::threading::ConditionVariableWrapper::waitFor |
( |
std::unique_lock< std::mutex > & |
lock, |
|
|
const std::chrono::duration< Rep, Period > & |
rel_time, |
|
|
Predicate |
pred |
|
) |
| |
This function will freeze any associated thread PowerResource
on the thread, ensuring that the system may enter a lower power state upon waiting. Upon unblocking, the thread PowerResource
will be thawed.
Refer to documentation for std::condition_variable for more information on standard behavior.
- Template Parameters
-
Rep | The data type used in representing the duration. |
Period | The period used in representing the duration. |
Predicate | The predicate to evaluate. |
- Parameters
-
lock | The locked mutex. |
rel_time | The time to wait for. |
pred | The predicate to evaluate. |
- Returns
- The evaluation of pred.
◆ waitUntil()
template<typename Clock , typename Duration , typename Predicate >
bool alexaClientSDK::avsCommon::utils::threading::ConditionVariableWrapper::waitUntil |
( |
std::unique_lock< std::mutex > & |
lock, |
|
|
const std::chrono::time_point< Clock, Duration > & |
timeout_time, |
|
|
Predicate |
pred |
|
) |
| |
This function will freeze any associated thread PowerResource
on the thread, ensuring that the system may enter a lower power state upon waiting. Upon unblocking, the thread PowerResource
will be thawed.
Refer to documentation for std::condition_variable for more information on standard behavior.
- Template Parameters
-
Clock | The clock. |
Duration | The duration. |
Pred | The predicate to evaluate. |
- Parameters
-
lock | The locked mutex. |
timeout_time | The time to wait until. |
pred | The predicate to evaluate. |
- Returns
- The evaluation of pred.
The documentation for this class was generated from the following file:
AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.
Licensed under the Apache License, Version 2.0