Darknet/YOLO v3.0-88-gdee7eef
Object Detection Framework
 
Loading...
Searching...
No Matches
httplib::ThreadPool Class Reference

#include "httplib.hpp"

Inheritance diagram for httplib::ThreadPool:
Collaboration diagram for httplib::ThreadPool:

Classes

struct  worker
 

Public Member Functions

 ThreadPool (const ThreadPool &)=delete
 
 ThreadPool (size_t n)
 
 ~ThreadPool () override=default
 
void enqueue (std::function< void()> fn) override
 
void shutdown () override
 

Private Attributes

std::condition_variable cond_
 
std::list< std::function< void()> > jobs_
 
std::mutex mutex_
 
bool shutdown_
 
std::vector< std::thread > threads_
 

Friends

struct worker
 

Constructor & Destructor Documentation

◆ ThreadPool() [1/2]

httplib::ThreadPool::ThreadPool ( size_t  n)
inlineexplicit

◆ ThreadPool() [2/2]

httplib::ThreadPool::ThreadPool ( const ThreadPool )
delete

◆ ~ThreadPool()

httplib::ThreadPool::~ThreadPool ( )
overridedefault

Member Function Documentation

◆ enqueue()

void httplib::ThreadPool::enqueue ( std::function< void()>  fn)
inlineoverridevirtual

Implements httplib::TaskQueue.

◆ shutdown()

void httplib::ThreadPool::shutdown ( )
inlineoverridevirtual

Implements httplib::TaskQueue.

Friends And Related Symbol Documentation

◆ worker

friend struct worker
friend

Member Data Documentation

◆ cond_

std::condition_variable httplib::ThreadPool::cond_
private

◆ jobs_

std::list<std::function<void()> > httplib::ThreadPool::jobs_
private

◆ mutex_

std::mutex httplib::ThreadPool::mutex_
private

◆ shutdown_

bool httplib::ThreadPool::shutdown_
private

◆ threads_

std::vector<std::thread> httplib::ThreadPool::threads_
private

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