My Project
Public Member Functions | Data Fields
LibThread::ThreadPool Class Reference

Public Member Functions

 ThreadPool (Scheduler *sched, int n)
 
 ThreadPool (int n)
 
 ~ThreadPool ()
 
ThreadStategetThread (int i)
 
void shutdown (bool wait)
 
void addThread (ThreadState *thread)
 
void attachJob (Job *job)
 
void detachJob (Job *job)
 
void queueJob (Job *job)
 
void broadcastJob (Job *job)
 
void cancelDeps (Job *job)
 
void cancelJob (Job *job)
 
void waitJob (Job *job)
 
void clearThreadState ()
 
- Public Member Functions inherited from LibThread::SharedObject
 SharedObject ()
 
virtual ~SharedObject ()
 
void set_type (int type_init)
 
int get_type ()
 
void set_name (std::string &name_init)
 
void set_name (const char *s)
 
std::stringget_name ()
 
void incref (int by=1)
 
long decref ()
 
long getref ()
 
virtual BOOLEAN op2 (int op, leftv res, leftv a1, leftv a2)
 
virtual BOOLEAN op3 (int op, leftv res, leftv a1, leftv a2, leftv a3)
 

Data Fields

Schedulerscheduler
 
int nthreads
 

Detailed Description

Definition at line 1633 of file shared.cc.

Constructor & Destructor Documentation

◆ ThreadPool() [1/2]

LibThread::ThreadPool::ThreadPool ( Scheduler sched,
int  n 
)

Definition at line 1921 of file shared.cc.

1921 : SharedObject(), nthreads(n) {
1922 scheduler = sched;
1923 acquireShared(sched);
1924}
Scheduler * scheduler
Definition: shared.cc:1635
void acquireShared(SharedObject *obj)
Definition: shared.cc:193

◆ ThreadPool() [2/2]

LibThread::ThreadPool::ThreadPool ( int  n)

Definition at line 1917 of file shared.cc.

1917 : SharedObject(), nthreads(n) {
1918 scheduler = new Scheduler(n);
1920}

◆ ~ThreadPool()

LibThread::ThreadPool::~ThreadPool ( )

Definition at line 1925 of file shared.cc.

1925 {
1927}
void releaseShared(SharedObject *obj)
Definition: shared.cc:197

Member Function Documentation

◆ addThread()

void LibThread::ThreadPool::addThread ( ThreadState thread)

Definition at line 1930 of file shared.cc.

1930 {
1931 scheduler->addThread(this, thread);
1932}
void addThread(ThreadPool *owner, ThreadState *thread)
Definition: shared.cc:1735

◆ attachJob()

void LibThread::ThreadPool::attachJob ( Job job)

Definition at line 1933 of file shared.cc.

1933 {
1934 scheduler->attachJob(this, job);
1935}
void attachJob(ThreadPool *pool, Job *job)
Definition: shared.cc:1742

◆ broadcastJob()

void LibThread::ThreadPool::broadcastJob ( Job job)

Definition at line 1942 of file shared.cc.

1942 {
1943 scheduler->broadcastJob(this, job);
1944}
void broadcastJob(ThreadPool *pool, Job *job)
Definition: shared.cc:1776

◆ cancelDeps()

void LibThread::ThreadPool::cancelDeps ( Job job)

Definition at line 1945 of file shared.cc.

1945 {
1946 scheduler->cancelDeps(job);
1947}
void cancelDeps(Job *job)
Definition: shared.cc:1786

◆ cancelJob()

void LibThread::ThreadPool::cancelJob ( Job job)

Definition at line 1948 of file shared.cc.

1948 {
1949 scheduler->cancelJob(job);
1950}
void cancelJob(Job *job)
Definition: shared.cc:1795

◆ clearThreadState()

void LibThread::ThreadPool::clearThreadState ( )

Definition at line 1954 of file shared.cc.

1954 {
1956}
void clearThreadState()
Definition: shared.cc:1826

◆ detachJob()

void LibThread::ThreadPool::detachJob ( Job job)

Definition at line 1936 of file shared.cc.

1936 {
1937 scheduler->detachJob(job);
1938}
void detachJob(Job *job)
Definition: shared.cc:1758

◆ getThread()

ThreadState * LibThread::ThreadPool::getThread ( int  i)

Definition at line 1928 of file shared.cc.

1928{ return scheduler->getThread(i); }
int i
Definition: cfEzgcd.cc:132
ThreadState * getThread(int i)
Definition: shared.cc:1708

◆ queueJob()

void LibThread::ThreadPool::queueJob ( Job job)

Definition at line 1939 of file shared.cc.

1939 {
1940 scheduler->queueJob(job);
1941}
void queueJob(Job *job)
Definition: shared.cc:1770

◆ shutdown()

void LibThread::ThreadPool::shutdown ( bool  wait)

Definition at line 1929 of file shared.cc.

1929{ scheduler->shutdown(wait); }
void shutdown(bool wait)
Definition: shared.cc:1709
wait
Definition: si_signals.h:51

◆ waitJob()

void LibThread::ThreadPool::waitJob ( Job job)

Definition at line 1951 of file shared.cc.

1951 {
1952 scheduler->waitJob(job);
1953}
void waitJob(Job *job)
Definition: shared.cc:1806

Field Documentation

◆ nthreads

int LibThread::ThreadPool::nthreads

Definition at line 1636 of file shared.cc.

◆ scheduler

Scheduler* LibThread::ThreadPool::scheduler

Definition at line 1635 of file shared.cc.


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