Suspension manager implements logic for suspending the UI thread when there is no input, tasks or timed events.
More...
#include <kanzi/core.ui/platform/application/common/suspension_manager.hpp>
Suspension manager implements logic for suspending the UI thread when there is no input, tasks or timed events.
This is a class used internally by Application.
kanzi::SuspensionManager::SuspensionManager |
( |
| ) |
|
|
explicit |
kanzi::SuspensionManager::~SuspensionManager |
( |
| ) |
|
void kanzi::SuspensionManager::setTaskDispatcherEventHandle |
( |
NativeEventHandle |
nativeHandle | ) |
|
|
inline |
Sets the native event handle that is used in waiting for task dispatcher.
Sets the native event handle that is used in waiting for input.
bool kanzi::SuspensionManager::needsPolling |
( |
| ) |
const |
|
inline |
Checks if an event source needs polling.
Polling is needed when an event source does not have the capability to abort suspension.
- Returns
- True, when at least one event source needs polling.
void kanzi::SuspensionManager::suspend |
( |
optional< chrono::milliseconds > |
timeout | ) |
|
|
inline |
Suspends the UI thread until any of the following conditions are met:
- Input is available.
- Native windowing system messages are available.
- Tasks in the TaskScheduler of this thread are available.
- Timeout expires.
- Parameters
-
timeout | Optional maximum suspend time. |
void kanzi::SuspensionManager::yield |
( |
chrono::milliseconds |
timeout | ) |
|
|
inline |
Yields priority to other processes and threads for given amount of milliseconds.
- Parameters
-
timeout | Number of milliseconds to sleep. Sleeping for 0 milliseconds or returns immediately. |
The documentation for this class was generated from the following file: