BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface 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

Definition at line 33 of file thread_d.hpp.

Constructor & Destructor Documentation

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

Definition at line 35 of file thread_d.hpp.

fc::thread_d::~thread_d ( )
inline

Definition at line 54 of file thread_d.hpp.

Member Function Documentation

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.

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

Definition at line 174 of file thread_d.hpp.

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.

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.

void fc::thread_d::cleanup_thread_specific_data ( )
inline

Definition at line 782 of file thread_d.hpp.

void fc::thread_d::clear_free_list ( )
inline

Definition at line 551 of file thread_d.hpp.

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

Definition at line 318 of file thread_d.hpp.

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

Definition at line 247 of file thread_d.hpp.

bool fc::thread_d::has_next_task ( )
inline

Definition at line 542 of file thread_d.hpp.

void fc::thread_d::move_newly_scheduled_tasks_to_task_pqueue ( )
inline

Definition at line 287 of file thread_d.hpp.

void fc::thread_d::notify_task_has_been_canceled ( )
inline

Definition at line 793 of file thread_d.hpp.

bool fc::thread_d::process_canceled_tasks ( )
inline

Definition at line 330 of file thread_d.hpp.

void fc::thread_d::process_tasks ( )
inline

Definition at line 558 of file thread_d.hpp.

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

Definition at line 180 of file thread_d.hpp.

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

Definition at line 195 of file thread_d.hpp.

void fc::thread_d::run_next_task ( )
inline

Definition at line 529 of file thread_d.hpp.

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.

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

Definition at line 509 of file thread_d.hpp.

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

Definition at line 692 of file thread_d.hpp.

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

Definition at line 742 of file thread_d.hpp.

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

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

Definition at line 112 of file thread_d.hpp.

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

Definition at line 92 of file thread_d.hpp.

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

Definition at line 106 of file thread_d.hpp.

bool fc::thread_d::done

Definition at line 104 of file thread_d.hpp.

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

Definition at line 102 of file thread_d.hpp.

std::string fc::thread_d::name

Definition at line 105 of file thread_d.hpp.

uint64_t fc::thread_d::next_posted_num

Definition at line 99 of file thread_d.hpp.

unsigned fc::thread_d::next_unused_task_storage_slot

Definition at line 120 of file thread_d.hpp.

unsigned fc::thread_d::non_preemptable_scope_count

Definition at line 125 of file thread_d.hpp.

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

Definition at line 119 of file thread_d.hpp.

thread_idle_notifier* fc::thread_d::notifier

Definition at line 122 of file thread_d.hpp.

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

Definition at line 108 of file thread_d.hpp.

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

Definition at line 110 of file thread_d.hpp.

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

Definition at line 91 of file thread_d.hpp.

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

Definition at line 101 of file thread_d.hpp.

stack_allocator fc::thread_d::stack_alloc

Definition at line 93 of file thread_d.hpp.

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

Definition at line 97 of file thread_d.hpp.

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

Definition at line 98 of file thread_d.hpp.

boost::condition_variable fc::thread_d::task_ready

Definition at line 94 of file thread_d.hpp.

boost::mutex fc::thread_d::task_ready_mutex

Definition at line 95 of file thread_d.hpp.

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

Definition at line 100 of file thread_d.hpp.

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: