Lely core libraries
2.3.4
|
This header file is part of the utilities library; it contains the C++ interface for the fiber implementation. More...
#include <lely/libc/type_traits.hpp>
#include <lely/util/error.hpp>
#include <lely/util/fiber.h>
#include <utility>
Go to the source code of this file.
Enumerations | |
enum class | lely::util::FiberFlag { SAVE_MASK = FIBER_SAVE_MASK , SAVE_FENV = FIBER_SAVE_FENV , SAVE_ERROR = FIBER_SAVE_ERROR , SAVE_ALL = FIBER_SAVE_ALL , GUARD_STACK = FIBER_GUARD_STACK } |
Specifies which properties of the calling environment are saved or restored by a fiber when it is suspended or resumed and how its stack is allocated. More... | |
This header file is part of the utilities library; it contains the C++ interface for the fiber implementation.
The design of the C++ interface is based on the fiber class in Boost.Context. It is a wrapper around #fiber_t*
which tries to prevent accidentally resuming a running or terminated fiber. The API is designed to be a building block for higher level constructs. For example, a call/cc operator similar to the one in Scheme can be implemented as:
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Definition in file fiber.hpp.
|
strong |
Specifies which properties of the calling environment are saved or restored by a fiber when it is suspended or resumed and how its stack is allocated.
Enumerator | |
---|---|
SAVE_MASK | The fiber saves and restores the signal mask (only supported on POSIX platforms). |
SAVE_FENV | The fiber saves and restores the floating-point environment. |
SAVE_ERROR | The fiber saves and restores the error values (i.e., errno and GetLastError() on Windows). |
SAVE_ALL | The combination of FiberFlag::SAVE_MASK, FiberFlag::SAVE_FENV and FiberFlag::SAVE_ERROR that is supported by the platform. |
GUARD_STACK | The fiber adds a guard page when allocating the stack frame so that the kernel generates a SIGSEGV signal on stack overflow (only supported on those POSIX platforms where mmap() supports anonymous mappings). |