2
0
mirror of https://github.com/boostorg/fiber.git synced 2026-02-20 02:32:19 +00:00

support for fiber properties + custom scheduler

This commit is contained in:
Oliver Kowalke
2015-09-29 17:54:29 +02:00
parent b03ab3b3ba
commit 4c791a3790
14 changed files with 458 additions and 29 deletions

View File

@@ -68,7 +68,8 @@ context::context( main_context_t) :
tp_( (std::chrono::steady_clock::time_point::max)() ),
fss_data_(),
wait_queue_(),
splk_() {
splk_(),
properties_( nullptr) {
}
// dispatcher fiber context
@@ -94,7 +95,8 @@ context::context( dispatcher_context_t, boost::context::preallocated const& pall
tp_( (std::chrono::steady_clock::time_point::max)() ),
fss_data_(),
wait_queue_(),
splk_() {
splk_(),
properties_( nullptr) {
}
context::~context() {
@@ -103,6 +105,7 @@ context::~context() {
BOOST_ASSERT( ! remote_ready_is_linked() );
BOOST_ASSERT( ! sleep_is_linked() );
BOOST_ASSERT( ! wait_is_linked() );
delete properties_;
}
void
@@ -278,6 +281,12 @@ context::set_fss_data( void const * vp,
}
}
void
context::set_properties( fiber_properties * props) {
delete properties_;
properties_ = props;
}
bool
context::worker_is_linked() {
std::unique_lock< detail::spinlock > lk( hook_splk_);