acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
aaa_thread.h
1#pragma once
2
3
4template < typename PRED >
5void defer_main_thread(PRED pred)
6{
7
8 if (::winrt::Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow->Dispatcher->HasThreadAccess)
9 {
10
11 pred();
12
13 }
14 else
15 {
16
17 ::wait(
18 ::winrt::Windows::ApplicationModel::Core::CoreApplication::MainView->CoreWindow->Dispatcher->RunAsync(
19 ::winrt::Windows::UI::Core::CoreDispatcherPriority::Normal,
20 ref aaa_primitive_new ::winrt::Windows::UI::Core::DispatchedHandler([&pred]()
21 {
22
23 pred();
24
25 })));
26
27 }
28
29}
Definition cfref.h:37