BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Classes | Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
fc::thread_d Class Reference

#include <thread_d.hpp>

Classes

struct  task_priority_less
 
struct  task_when_less
 

Public Types

using context_pair = std::pair< thread_d *, fc::context * >
 

Public Member Functions

 thread_d (fc::thread &s, thread_idle_notifier *n=0)
 
 ~thread_d ()
 
void add_to_blocked (fc::context *c)
 
void pt_push_back (fc::context *c)
 
fc::context::ptr ready_pop_front ()
 
void add_context_to_ready_list (context *context_to_add, bool at_end=false)
 
void enqueue (task_base *t)
 
void move_newly_scheduled_tasks_to_task_pqueue ()
 
task_basedequeue ()
 
bool process_canceled_tasks ()
 
void check_fiber_exceptions ()
 
bool start_next_fiber (bool reschedule=false)
 
void run_next_task ()
 
bool has_next_task ()
 
void clear_free_list ()
 
void process_tasks ()
 
time_point check_for_timeouts ()
 
void unblock (fc::context *c)
 
void yield_until (const time_point &tp, bool reschedule)
 
void wait (const promise_base::ptr &p, const time_point &timeout)
 
void cleanup_thread_specific_data ()
 
void notify_task_has_been_canceled ()
 

Static Public Member Functions

static void start_process_tasks (intptr_t my)
 

Public Attributes

fc::threadself
 
boost::thread * boost_thread
 
stack_allocator stack_alloc
 
boost::condition_variable task_ready
 
boost::mutex task_ready_mutex
 
boost::atomic< task_base * > task_in_queue
 
std::vector< task_base * > task_pqueue
 
uint64_t next_posted_num
 
std::vector< task_base * > task_sch_queue
 
std::vector< fc::context * > sleep_pqueue
 
std::vector< fc::context * > free_list
 
bool done
 
std::string name
 
fc::contextcurrent
 
fc::contextpt_head
 
std::vector< fc::context * > ready_heap
 
fc::contextblocked
 
std::vector< detail::specific_data_infothread_specific_data
 
std::vector< detail::specific_data_infonon_task_specific_data
 
unsigned next_unused_task_storage_slot
 
thread_idle_notifiernotifier
 
unsigned non_preemptable_scope_count
 

Detailed Description

Definition at line 30 of file thread_d.hpp.

Member Typedef Documentation

◆ context_pair

Definition at line 33 of file thread_d.hpp.

Constructor & Destructor Documentation

◆ thread_d()

fc::thread_d::thread_d ( fc::thread s,
thread_idle_notifier n = 0 
)
inline

Definition at line 35 of file thread_d.hpp.

◆ ~thread_d()

fc::thread_d::~thread_d ( )
inline

Definition at line 54 of file thread_d.hpp.

Member Function Documentation

◆ add_context_to_ready_list()

void fc::thread_d::add_context_to_ready_list ( context context_to_add,
bool  at_end = false 
)
inline

Definition at line 203 of file thread_d.hpp.

◆ add_to_blocked()

void fc::thread_d::add_to_blocked ( fc::context c)
inline

Definition at line 174 of file thread_d.hpp.

◆ check_fiber_exceptions()

void fc::thread_d::check_fiber_exceptions ( )
inline

This should be before or after a context switch to detect quit/cancel operations and throw an exception.

Definition at line 358 of file thread_d.hpp.

◆ check_for_timeouts()

time_point fc::thread_d::check_for_timeouts ( )
inline

Return system_clock::time_point::min() if tasks have timed out Retunn system_clock::time_point::max() if there are no scheduled tasks Return the time the next task needs to be run if there is anything scheduled.

Definition at line 650 of file thread_d.hpp.

◆ cleanup_thread_specific_data()

void fc::thread_d::cleanup_thread_specific_data ( )
inline

Definition at line 782 of file thread_d.hpp.

◆ clear_free_list()

void fc::thread_d::clear_free_list ( )
inline

Definition at line 551 of file thread_d.hpp.

◆ dequeue()

task_base* fc::thread_d::dequeue ( )
inline

Definition at line 318 of file thread_d.hpp.

◆ enqueue()

void fc::thread_d::enqueue ( task_base t)
inline

Definition at line 247 of file thread_d.hpp.

◆ has_next_task()

bool fc::thread_d::has_next_task ( )
inline

Definition at line 542 of file thread_d.hpp.

◆ move_newly_scheduled_tasks_to_task_pqueue()

void fc::thread_d::move_newly_scheduled_tasks_to_task_pqueue ( )
inline

Definition at line 287 of file thread_d.hpp.

◆ notify_task_has_been_canceled()

void fc::thread_d::notify_task_has_been_canceled ( )
inline

Definition at line 793 of file thread_d.hpp.

◆ process_canceled_tasks()

bool fc::thread_d::process_canceled_tasks ( )
inline

Definition at line 330 of file thread_d.hpp.

◆ process_tasks()

void fc::thread_d::process_tasks ( )
inline

Definition at line 558 of file thread_d.hpp.

◆ pt_push_back()

void fc::thread_d::pt_push_back ( fc::context c)
inline

Definition at line 180 of file thread_d.hpp.

◆ ready_pop_front()

fc::context::ptr fc::thread_d::ready_pop_front ( )
inline

Definition at line 195 of file thread_d.hpp.

◆ run_next_task()

void fc::thread_d::run_next_task ( )
inline

Definition at line 529 of file thread_d.hpp.

◆ start_next_fiber()

bool fc::thread_d::start_next_fiber ( bool  reschedule = false)
inline

Find the next available context and switch to it. If none are available then create a new context and have it wait for something to do.

Definition at line 381 of file thread_d.hpp.

◆ start_process_tasks()

static void fc::thread_d::start_process_tasks ( intptr_t  my)
inlinestatic

Definition at line 509 of file thread_d.hpp.

◆ unblock()

void fc::thread_d::unblock ( fc::context c)
inline

Definition at line 692 of file thread_d.hpp.

◆ wait()

void fc::thread_d::wait ( const promise_base::ptr p,
const time_point timeout 
)
inline

Definition at line 742 of file thread_d.hpp.

◆ yield_until()

void fc::thread_d::yield_until ( const time_point tp,
bool  reschedule 
)
inline

Definition at line 704 of file thread_d.hpp.

Member Data Documentation

◆ blocked

fc::context* fc::thread_d::blocked

Definition at line 112 of file thread_d.hpp.

◆ boost_thread

boost::thread* fc::thread_d::boost_thread

Definition at line 92 of file thread_d.hpp.

◆ current

fc::context* fc::thread_d::current

Definition at line 106 of file thread_d.hpp.

◆ done

bool fc::thread_d::done

Definition at line 104 of file thread_d.hpp.

◆ free_list

std::vector<fc::context*> fc::thread_d::free_list

Definition at line 102 of file thread_d.hpp.

◆ name

std::string fc::thread_d::name

Definition at line 105 of file thread_d.hpp.

◆ next_posted_num

uint64_t fc::thread_d::next_posted_num

Definition at line 99 of file thread_d.hpp.

◆ next_unused_task_storage_slot

unsigned fc::thread_d::next_unused_task_storage_slot

Definition at line 120 of file thread_d.hpp.

◆ non_preemptable_scope_count

unsigned fc::thread_d::non_preemptable_scope_count

Definition at line 125 of file thread_d.hpp.

◆ non_task_specific_data

std::vector<detail::specific_data_info> fc::thread_d::non_task_specific_data

Definition at line 119 of file thread_d.hpp.

◆ notifier

thread_idle_notifier* fc::thread_d::notifier

Definition at line 122 of file thread_d.hpp.

◆ pt_head

fc::context* fc::thread_d::pt_head

Definition at line 108 of file thread_d.hpp.

◆ ready_heap

std::vector<fc::context*> fc::thread_d::ready_heap

Definition at line 110 of file thread_d.hpp.

◆ self

fc::thread& fc::thread_d::self

Definition at line 91 of file thread_d.hpp.

◆ sleep_pqueue

std::vector<fc::context*> fc::thread_d::sleep_pqueue

Definition at line 101 of file thread_d.hpp.

◆ stack_alloc

stack_allocator fc::thread_d::stack_alloc

Definition at line 93 of file thread_d.hpp.

◆ task_in_queue

boost::atomic<task_base*> fc::thread_d::task_in_queue

Definition at line 97 of file thread_d.hpp.

◆ task_pqueue

std::vector<task_base*> fc::thread_d::task_pqueue

Definition at line 98 of file thread_d.hpp.

◆ task_ready

boost::condition_variable fc::thread_d::task_ready

Definition at line 94 of file thread_d.hpp.

◆ task_ready_mutex

boost::mutex fc::thread_d::task_ready_mutex

Definition at line 95 of file thread_d.hpp.

◆ task_sch_queue

std::vector<task_base*> fc::thread_d::task_sch_queue

Definition at line 100 of file thread_d.hpp.

◆ thread_specific_data

std::vector<detail::specific_data_info> fc::thread_d::thread_specific_data

Definition at line 115 of file thread_d.hpp.


The documentation for this class was generated from the following file: