Loading...
Searching...
No Matches
libthread.h
Go to the documentation of this file.
#ifndef _LIBTHREAD_THREADPOOL_H
#define _LIBTHREAD_THREADPOOL_H
namespace LibThread {
class ThreadPool;
class Job;
// thread pools
ThreadPool *createThreadPool(int threads, int prioThreads = 0);
void closeThreadPool(ThreadPool *pool, bool wait);
ThreadPool *getCurrentThreadPool();
// job creation
Job *createJob(void (*func)(leftv result, leftv arg));
Job *createJob(void (*func)(long ndeps, Job **deps));
// job status
Job *getCurrentJob();
bool getJobCancelled();
bool getJobCancelled(Job *job);
void addJobArgs(Job *job, leftv arg);
void setJobData(Job *job, void *data);
void *getJobData(Job *job);
leftv getJobResult(Job *job);
const char *getJobName();
void setJobName(const char *);
// Job scheduling
Job *startJob(ThreadPool *pool, Job *job, leftv arg);
Job *startJob(ThreadPool *pool, Job *job);
// Job *scheduleJob(ThreadPool *pool, Job *job, long ndeps, Job **deps);
void cancelJob(Job *job);
void waitJob(Job *job);
// reference counting
void release(Job *job);
void release(ThreadPool *pool);
void retain(Job *job);
void retain(ThreadPool *pool);
}
#endif
LibThread::Job
Definition shared.cc:1544
LibThread::ThreadPool
Definition shared.cc:1628
result
return result
Definition facAbsBiFact.cc:76
LibThread
Definition bytebuf.h:8
LibThread::retain
void retain(Job *job)
LibThread::getCurrentJob
Job * getCurrentJob()
Definition shared.cc:2514
LibThread::getJobCancelled
bool getJobCancelled()
Definition shared.cc:2640
LibThread::startJob
Job * startJob(ThreadPool *pool, Job *job, leftv arg)
Definition shared.cc:2476
LibThread::createThreadPool
ThreadPool * createThreadPool(int threads, int prioThreads=0)
Definition shared.cc:2213
LibThread::setJobData
void setJobData(Job *job, void *data)
Definition shared.cc:2644
LibThread::getCurrentThreadPool
ThreadPool * getCurrentThreadPool()
Definition shared.cc:2240
LibThread::addJobArgs
void addJobArgs(Job *job, leftv arg)
Definition shared.cc:2660
LibThread::getJobData
void * getJobData(Job *job)
Definition shared.cc:2652
LibThread::closeThreadPool
void closeThreadPool(ThreadPool *pool, bool wait)
Definition shared.cc:2324
LibThread::createJob
Job * createJob(void(*func)(leftv result, leftv arg))
Definition shared.cc:2466
LibThread::release
void release(Job *job)
LibThread::getJobName
const char * getJobName()
LibThread::setJobName
void setJobName(const char *)
LibThread::getJobResult
leftv getJobResult(Job *job)
Definition shared.cc:2670
LibThread::cancelJob
void cancelJob(Job *job)
Definition shared.cc:2509
LibThread::waitJob
void waitJob(Job *job)
Definition shared.cc:2585
wait
wait
Definition si_signals.h:61
leftv
sleftv * leftv
Definition structs.h:53