My Project
Loading...
Searching...
No Matches
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::string & get_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 1628 of file shared.cc.

Constructor & Destructor Documentation

◆ ThreadPool() [1/2]

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

Definition at line 1916 of file shared.cc.

1916 : SharedObject(), nthreads(n) {
1917 scheduler = sched;
1918 acquireShared(sched);
1919}
Scheduler * scheduler
Definition shared.cc:1630
void acquireShared(SharedObject *obj)
Definition shared.cc:188

◆ ThreadPool() [2/2]

LibThread::ThreadPool::ThreadPool ( int n)

Definition at line 1912 of file shared.cc.

1912 : SharedObject(), nthreads(n) {
1913 scheduler = new Scheduler(n);
1915}

◆ ~ThreadPool()

LibThread::ThreadPool::~ThreadPool ( )

Definition at line 1920 of file shared.cc.

1920 {
1922}
void releaseShared(SharedObject *obj)
Definition shared.cc:192

Member Function Documentation

◆ addThread()

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

Definition at line 1925 of file shared.cc.

1925 {
1926 scheduler->addThread(this, thread);
1927}

◆ attachJob()

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

Definition at line 1928 of file shared.cc.

1928 {
1929 scheduler->attachJob(this, job);
1930}

◆ broadcastJob()

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

Definition at line 1937 of file shared.cc.

1937 {
1938 scheduler->broadcastJob(this, job);
1939}

◆ cancelDeps()

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

Definition at line 1940 of file shared.cc.

1940 {
1941 scheduler->cancelDeps(job);
1942}

◆ cancelJob()

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

Definition at line 1943 of file shared.cc.

1943 {
1944 scheduler->cancelJob(job);
1945}

◆ clearThreadState()

void LibThread::ThreadPool::clearThreadState ( )

Definition at line 1949 of file shared.cc.

1949 {
1950 scheduler->clearThreadState();
1951}

◆ detachJob()

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

Definition at line 1931 of file shared.cc.

1931 {
1932 scheduler->detachJob(job);
1933}

◆ getThread()

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

Definition at line 1923 of file shared.cc.

1923{ return scheduler->getThread(i); }
int i
Definition cfEzgcd.cc:132

◆ queueJob()

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

Definition at line 1934 of file shared.cc.

1934 {
1935 scheduler->queueJob(job);
1936}

◆ shutdown()

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

Definition at line 1924 of file shared.cc.

1924{ scheduler->shutdown(wait); }
wait
Definition si_signals.h:61

◆ waitJob()

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

Definition at line 1946 of file shared.cc.

1946 {
1947 scheduler->waitJob(job);
1948}

Field Documentation

◆ nthreads

int LibThread::ThreadPool::nthreads

Definition at line 1631 of file shared.cc.

◆ scheduler

Scheduler* LibThread::ThreadPool::scheduler

Definition at line 1630 of file shared.cc.


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