YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
execution_context.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <yaclib/config.hpp>
4
#include <
yaclib/fault/detail/fiber/stack_allocator.hpp
>
5
6
#include <ucontext.h>
7
8
#ifdef YACLIB_ASAN
9
# include <sanitizer/asan_interface.h>
10
#endif
11
12
namespace
yaclib::detail::fiber
{
13
14
using
Trampoline
=
void
(*)(
void
*
arg
);
15
16
class
ExecutionContext
final
{
17
public
:
18
void
Setup
(
Allocation
stack
,
Trampoline
trampoline
,
void
*
arg
);
19
20
void
Start
();
21
22
void
SwitchTo
(
ExecutionContext
&
other
);
23
24
void
Exit
(
ExecutionContext
&
other
);
25
26
private
:
27
ucontext_t _context;
28
};
29
30
}
// namespace yaclib::detail::fiber
yaclib::detail::fiber::ExecutionContext
Definition
execution_context.hpp:16
yaclib::detail::fiber::ExecutionContext::SwitchTo
void SwitchTo(ExecutionContext &other)
Definition
execution_context.cpp:22
yaclib::detail::fiber::ExecutionContext::Setup
void Setup(Allocation stack, Trampoline trampoline, void *arg)
Definition
execution_context.cpp:7
yaclib::detail::fiber::ExecutionContext::Exit
void Exit(ExecutionContext &other)
Definition
execution_context.cpp:33
yaclib::detail::fiber::ExecutionContext::Start
void Start()
Definition
execution_context.cpp:16
yaclib::detail::fiber
Definition
atomic.hpp:7
yaclib::detail::fiber::Trampoline
void(*)(void *arg) Trampoline
Definition
execution_context.hpp:14
yaclib::MakeContract
Contract< V, E > MakeContract()
Creates related future and promise.
Definition
contract.hpp:25
stack_allocator.hpp
yaclib::detail::fiber::Allocation
Definition
stack_allocator.hpp:7
include
yaclib
fault
detail
fiber
execution_context.hpp
Generated by
1.9.8