The Joe Engine
Joe's engine programming playground
JoeEngine::JEThreadPool Class Reference

The JEThreadPool class. More...

#include <ThreadPool.h>

Public Member Functions

 JEThreadPool ()
 Constructor. More...
 
 ~JEThreadPool ()
 Destructor. More...
 
void EnqueueJob (JEThreadJob job)
 Enqueue thread job. More...
 

Detailed Description

The JEThreadPool class.

Class that manages any number of threads and a queue of tasks to complete. Threads are created and launched upon construction. Threads run in an infinite loop, block until the queue is populated with a task (or multiple), then execute the task.

Constructor & Destructor Documentation

◆ JEThreadPool()

JoeEngine::JEThreadPool::JEThreadPool ( )
inline

Constructor.

Creates and launches all threads in the pool.

◆ ~JEThreadPool()

JoeEngine::JEThreadPool::~JEThreadPool ( )
inline

Destructor.

Joins threads.

Member Function Documentation

◆ EnqueueJob()

void JoeEngine::JEThreadPool::EnqueueJob ( JEThreadJob  job)

Enqueue thread job.

Synchronously add a new thread job to the job queue.

Parameters
jobthe job to enqueue.

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