/usr/include/boost/asio/detail/impl
NameSizeModeActions
buffer_sequence_adapter.ipp30960644editdlrm
descriptor_ops.ipp150910644editdlrm
dev_poll_reactor.hpp25870644editdlrm
dev_poll_reactor.ipp131380644editdlrm
epoll_reactor.hpp24390644editdlrm
epoll_reactor.ipp223720644editdlrm
eventfd_select_interrupter.ipp45980644editdlrm
handler_tracking.ipp117820644editdlrm
kqueue_reactor.hpp25900644editdlrm
kqueue_reactor.ipp170450644editdlrm
null_event.ipp19060644editdlrm
pipe_select_interrupter.ipp31760644editdlrm
posix_event.ipp17760644editdlrm
posix_mutex.ipp12350644editdlrm
posix_thread.ipp19640644editdlrm
posix_tss_ptr.ipp12610644editdlrm
reactive_descriptor_service.ipp63880644editdlrm
reactive_serial_port_service.ipp42780644editdlrm
reactive_socket_service_base.ipp88020644editdlrm
resolver_service_base.ipp38910644editdlrm
scheduler.ipp158920644editdlrm
select_reactor.hpp29850644editdlrm
select_reactor.ipp93520644editdlrm
service_registry.hpp26520644editdlrm
service_registry.ipp54620644editdlrm
signal_set_service.ipp203760644editdlrm
socket_ops.ipp1137980644editdlrm
socket_select_interrupter.ipp58580644editdlrm
strand_executor_service.hpp115700644editdlrm
strand_executor_service.ipp36370644editdlrm
strand_service.hpp35740644editdlrm
strand_service.ipp50370644editdlrm
throw_error.ipp12680644editdlrm
timer_queue_ptime.ipp24100644editdlrm
timer_queue_set.ipp23170644editdlrm
winrt_ssocket_service_base.ipp175130644editdlrm
winrt_timer_scheduler.hpp26640644editdlrm
winrt_timer_scheduler.ipp29620644editdlrm
winsock_init.ipp20500644editdlrm
win_event.ipp20680644editdlrm
win_iocp_handle_service.ipp143940644editdlrm
win_iocp_io_context.hpp30260644editdlrm
win_iocp_io_context.ipp166340644editdlrm
win_iocp_serial_port_service.ipp60210644editdlrm
win_iocp_socket_service_base.ipp250410644editdlrm
win_mutex.ipp22130644editdlrm
win_object_handle_service.ipp124950644editdlrm
win_static_mutex.ipp36360644editdlrm
win_thread.ipp41020644editdlrm
win_tss_ptr.ipp14480644editdlrm
Edit: /usr/include/boost/asio/detail/impl/strand_executor_service.ipp (3637B)
// // detail/impl/strand_executor_service.ipp // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // // Copyright (c) 2003-2020 Christopher M. Kohlhoff (chris at kohlhoff dot com) // // Distributed under the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) // #ifndef BOOST_ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_IPP #define BOOST_ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_IPP #if defined(_MSC_VER) && (_MSC_VER >= 1200) # pragma once #endif // defined(_MSC_VER) && (_MSC_VER >= 1200) #include #include #include namespace boost { namespace asio { namespace detail { strand_executor_service::strand_executor_service(execution_context& ctx) : execution_context_service_base(ctx), mutex_(), salt_(0), impl_list_(0) { } void strand_executor_service::shutdown() { op_queue ops; boost::asio::detail::mutex::scoped_lock lock(mutex_); strand_impl* impl = impl_list_; while (impl) { impl->mutex_->lock(); impl->shutdown_ = true; ops.push(impl->waiting_queue_); ops.push(impl->ready_queue_); impl->mutex_->unlock(); impl = impl->next_; } } strand_executor_service::implementation_type strand_executor_service::create_implementation() { implementation_type new_impl(new strand_impl); new_impl->locked_ = false; new_impl->shutdown_ = false; boost::asio::detail::mutex::scoped_lock lock(mutex_); // Select a mutex from the pool of shared mutexes. std::size_t salt = salt_++; std::size_t mutex_index = reinterpret_cast(new_impl.get()); mutex_index += (reinterpret_cast(new_impl.get()) >> 3); mutex_index ^= salt + 0x9e3779b9 + (mutex_index << 6) + (mutex_index >> 2); mutex_index = mutex_index % num_mutexes; if (!mutexes_[mutex_index].get()) mutexes_[mutex_index].reset(new mutex); new_impl->mutex_ = mutexes_[mutex_index].get(); // Insert implementation into linked list of all implementations. new_impl->next_ = impl_list_; new_impl->prev_ = 0; if (impl_list_) impl_list_->prev_ = new_impl.get(); impl_list_ = new_impl.get(); new_impl->service_ = this; return new_impl; } strand_executor_service::strand_impl::~strand_impl() { boost::asio::detail::mutex::scoped_lock lock(service_->mutex_); // Remove implementation from linked list of all implementations. if (service_->impl_list_ == this) service_->impl_list_ = next_; if (prev_) prev_->next_ = next_; if (next_) next_->prev_= prev_; } bool strand_executor_service::enqueue(const implementation_type& impl, scheduler_operation* op) { impl->mutex_->lock(); if (impl->shutdown_) { impl->mutex_->unlock(); op->destroy(); return false; } else if (impl->locked_) { // Some other function already holds the strand lock. Enqueue for later. impl->waiting_queue_.push(op); impl->mutex_->unlock(); return false; } else { // The function is acquiring the strand lock and so is responsible for // scheduling the strand. impl->locked_ = true; impl->mutex_->unlock(); impl->ready_queue_.push(op); return true; } } bool strand_executor_service::running_in_this_thread( const implementation_type& impl) { return !!call_stack::contains(impl.get()); } } // namespace detail } // namespace asio } // namespace boost #include #endif // BOOST_ASIO_DETAIL_IMPL_STRAND_EXECUTOR_SERVICE_IPP