Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PTL::ThreadData Class Reference

#include <ThreadData.hh>

Public Types

template<typename Tp >
using TaskStack = std::deque< Tp >
 

Public Member Functions

 ThreadData (ThreadPool *tp)
 
 ~ThreadData ()
 
void update ()
 

Static Public Member Functions

static ThreadData *& GetInstance ()
 

Public Attributes

bool is_master
 
bool within_task
 
intmax_t task_depth
 
ThreadPoolthread_pool
 
VUserTaskQueuecurrent_queue
 
TaskStack< VUserTaskQueue * > queue_stack
 

Detailed Description

Definition at line 99 of file ThreadData.hh.

Member Typedef Documentation

◆ TaskStack

template<typename Tp >
using PTL::ThreadData::TaskStack = std::deque<Tp>

Definition at line 103 of file ThreadData.hh.

Constructor & Destructor Documentation

◆ ThreadData()

ThreadData::ThreadData ( ThreadPool tp)

Definition at line 43 of file ThreadData.cc.

44: is_master(tp->is_master())
45, within_task(false)
46, task_depth(0)
47, thread_pool(tp)
48, current_queue(tp->get_queue())
50{}
VUserTaskQueue * current_queue
Definition: ThreadData.hh:115
TaskStack< VUserTaskQueue * > queue_stack
Definition: ThreadData.hh:116
ThreadPool * thread_pool
Definition: ThreadData.hh:114
intmax_t task_depth
Definition: ThreadData.hh:113

◆ ~ThreadData()

ThreadData::~ThreadData ( )

Definition at line 63 of file ThreadData.cc.

63{}

Member Function Documentation

◆ GetInstance()

ThreadData *& ThreadData::GetInstance ( )
static

Definition at line 35 of file ThreadData.cc.

36{
37 static thread_local ThreadData* _instance = nullptr;
38 return _instance;
39}

Referenced by PTL::UserTaskQueue::ExecuteOnAllThreads(), PTL::UserTaskQueue::ExecuteOnSpecificThreads(), PTL::ThreadPool::insert(), and PTL::VTaskGroup::wait().

◆ update()

void ThreadData::update ( )

Definition at line 55 of file ThreadData.cc.

56{
58 queue_stack.push_back(current_queue);
59}
task_queue_t * get_queue() const
Definition: ThreadPool.hh:135

Referenced by PTL::ThreadPool::execute_thread().

Member Data Documentation

◆ current_queue

VUserTaskQueue* PTL::ThreadData::current_queue

◆ is_master

bool PTL::ThreadData::is_master

Definition at line 111 of file ThreadData.hh.

Referenced by PTL::VTaskGroup::wait().

◆ queue_stack

TaskStack<VUserTaskQueue*> PTL::ThreadData::queue_stack

Definition at line 116 of file ThreadData.hh.

Referenced by update().

◆ task_depth

intmax_t PTL::ThreadData::task_depth

Definition at line 113 of file ThreadData.hh.

◆ thread_pool

ThreadPool* PTL::ThreadData::thread_pool

Definition at line 114 of file ThreadData.hh.

Referenced by update(), and PTL::VTaskGroup::wait().

◆ within_task

bool PTL::ThreadData::within_task

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