[+] AuAsync::DispatchOn

This commit is contained in:
Reece Wilson 2023-09-15 16:49:48 +01:00
parent addd4080b2
commit f1e9aa1d22

View File

@ -43,7 +43,13 @@ namespace Aurora::Async
*/
AUKN_SYM AuSPtr<IWorkItem> NewWorkFunction(const WorkerPId_t &worker, AuVoidFunc func);
/// Async app only | Thread pools must use the IThreadPool::NewFence function
static inline AuSPtr<IWorkItem> DispatchOn(const WorkerPId_t &worker, AuVoidFunc func)
{
auto pThat = NewWorkFunction(worker, func);
SysAssert(pThat);
return pThat->Dispatch();
}
AUKN_SYM AuSPtr<IWorkItem> NewFence();
AUKN_SYM AuSPtr<IThreadPool> NewThreadPool();