Lely core libraries
2.2.5
|
#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.
Data Structures | |
struct | lely::util::detail::FiberData |
class | lely::util::FiberThread |
Convenience class providing a RAII-style mechanism to ensure the fiber associated with the calling thread is intialized for the duration of a scoped block. More... | |
class | lely::util::Fiber |
A fiber. More... | |
class | lely::util::fiber_unwind |
The exception used by lely::util::Fiber::~Fiber() to terminate the callable object and unwind its stack. More... | |
Enumerations | |
enum | lely::util::FiberFlag { lely::util::FiberFlag::SAVE_MASK = FIBER_SAVE_MASK, lely::util::FiberFlag::SAVE_FENV = FIBER_SAVE_FENV, lely::util::FiberFlag::SAVE_ERROR = FIBER_SAVE_ERROR, lely::util::FiberFlag::SAVE_ALL = FIBER_SAVE_ALL, lely::util::FiberFlag::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. | |
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.