3#ifndef ENGINE_SHARED_JOBS_H
4#define ENGINE_SHARED_JOBS_H
62 virtual void Run() = 0;
107 virtual bool Abort();
CLock m_Lock
Definition: jobs.h:132
void Add(std::shared_ptr< IJob > pJob) REQUIRES(!m_Lock)
Definition: jobs.cpp:209
std::shared_ptr< IJob > m_pFirstJob GUARDED_BY(m_Lock)
static void WorkerThread(void *pUser) NO_THREAD_SAFETY_ANALYSIS
Definition: jobs.cpp:58
std::shared_ptr< IJob > m_pLastJob GUARDED_BY(m_Lock)
void RunLoop() NO_THREAD_SAFETY_ANALYSIS
Definition: jobs.cpp:63
void Shutdown() REQUIRES(!m_Lock) REQUIRES(!m_LockRunning)
Definition: jobs.cpp:149
SEMAPHORE m_Semaphore
Definition: jobs.h:133
void Init(int NumThreads) REQUIRES(!m_Lock)
Definition: jobs.cpp:129
std::deque< std::shared_ptr< IJob > > m_RunningJobs GUARDED_BY(m_LockRunning)
std::vector< void * > m_vpThreads
Definition: jobs.h:129
std::atomic< bool > m_Shutdown
Definition: jobs.h:130
CLock m_LockRunning
Definition: jobs.h:137
bool IsAbortable() const
Definition: jobs.cpp:40
bool Done() const
Definition: jobs.cpp:20
EJobState
Definition: jobs.h:28
@ STATE_QUEUED
Definition: jobs.h:32
@ STATE_RUNNING
Definition: jobs.h:37
@ STATE_DONE
Definition: jobs.h:42
@ STATE_ABORTED
Definition: jobs.h:50
void Abortable(bool Abortable)
Definition: jobs.cpp:35
EJobState State() const
Definition: jobs.cpp:15
IJob()
Definition: jobs.cpp:6
virtual bool Abort()
Definition: jobs.cpp:26
std::atomic< bool > m_Abortable
Definition: jobs.h:56
std::atomic< EJobState > m_State
Definition: jobs.h:55
std::shared_ptr< IJob > m_pNext
Definition: jobs.h:54
IJob(const IJob &Other)=delete
IJob & operator=(const IJob &Other)=delete
#define REQUIRES(...)
Definition: lock.h:32
#define NO_THREAD_SAFETY_ANALYSIS
Definition: lock.h:71
sem_t SEMAPHORE
Definition: system.h:669