Class · aurore

aurore::Threading

aurore/core/thread.hpp
#include <aurore/core/thread.hpp>

class aurore::Threading

Static functions 10

static void sync(std::function< void()> func)

Enqueue a function to be executed before the application is redrawn the next time.

Aurore is not thread-safe, and sync() provides a mechanism for queuing up UI-related state changes from other threads.

thread.hpp:84
static void async(std::function< void()> func)

Enqueue a function to be executed in parallel with application's main thread.

thread.hpp:90
static void asyncDecode(std::function< void()> func)

As async(), on a thread of its own for decoding pictures (ThemeImages, Image::setImageFromFileAsync): a large picture does not hold back the tasks of async() (the battery, the Wi-Fi, the app's own).

thread.hpp:97
static size_t delay(long milliseconds, std::function< void()> func)
static void cancelDelay(size_t iter)
static void start()
static void stop()
static void performSyncTasks()
static void setSyncTaskBudget(uint64_t microseconds)

Bounds the time the sync tasks may take on a frame, in microseconds: once it is spent, the tasks left run on the next frames, in order, so a burst of results (a page of covers) does not stall a frame. 0, the default, runs every task on the frame it was queued for.

thread.hpp:115
static bool isIdle()

True when no task is queued with sync(), async() or asyncDecode() and none is running on their threads (delay()s are not counted). The test harness waits for it before it calls a screen settled.

thread.hpp:122

Read from Aurore's headers by Doxygen at each build · library/include