libtasks Documentation
1.6
Main Page
Namespaces
Classes
Files
File List
File Members
exec.cpp
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2013-2014 ADTECH GmbH
3
* Licensed under MIT (https://github.com/adtechlabs/libtasks/blob/master/COPYING)
4
*
5
* Author: Andreas Pohl
6
*/
7
8
#include <
tasks/exec.h
>
9
#include <
tasks/exec_task.h
>
10
#include <
tasks/dispatcher.h
>
11
12
namespace
tasks {
13
14
void
exec
(
exec_task::func_t
f) {
dispatcher::instance
()->add_task(
new
exec_task
(f)); }
15
16
void
exec
(
exec_task::func_t
f,
task::finish_func_void_t
ff) {
17
exec_task
* t =
new
exec_task
(f);
18
t->
on_finish
(ff);
19
dispatcher::instance
()->add_task(t);
20
}
21
22
}
// tasks
tasks::task::finish_func_void_t
std::function< void()> finish_func_void_t
Definition:
task.h:22
tasks::dispatcher::instance
static std::shared_ptr< dispatcher > instance()
Definition:
dispatcher.h:75
tasks::task::on_finish
void on_finish(finish_func_worker_t f)
Definition:
task.h:56
tasks::exec
void exec(exec_task::func_t f)
Execute code in a separate executor thread.
Definition:
exec.cpp:14
tasks::exec_task::func_t
std::function< void()> func_t
Definition:
exec_task.h:20
dispatcher.h
exec_task.h
exec.h
tasks::exec_task
Definition:
exec_task.h:18
tasks
exec.cpp
Generated by
1.8.6