ZFFramework
 
Loading...
Searching...
No Matches
ZFThread_zfasync.h File Reference

thread utility More...

#include "ZFThread.h"

Go to the source code of this file.

Functions

zfautoT< ZFTaskIdzfasync (const ZFListener &callback, const ZFListener &finishCallback=(zft_zfnull))
 util to run code asynchronizely
 

Detailed Description

thread utility

Function Documentation

◆ zfasync()

zfautoT< ZFTaskId > zfasync ( const ZFListener & callback,
const ZFListener & finishCallback = (zft_zfnull) )
extern

util to run code asynchronizely

callback would run in new thread, finishCallback would run in ZFThread::mainThread

for the callback:

for the finishCallback:

when ZFTaskId::stop called after this method, the callback may or may not be canceled, but finishCallback would be canceled