Public Member Functions | Private Member Functions | Private Attributes | List of all members
absl::synchronization_internal::ThreadPool Class Reference

#include <thread_pool.h>

Public Member Functions

ThreadPooloperator= (const ThreadPool &)=delete
 
void Schedule (std::function< void()> func)
 
 ThreadPool (int num_threads)
 
 ThreadPool (const ThreadPool &)=delete
 
 ~ThreadPool ()
 

Private Member Functions

std::queue< std::function< void()> > queue_ GUARDED_BY (mu_)
 
bool WorkAvailable () const EXCLUSIVE_LOCKS_REQUIRED(mu_)
 
void WorkLoop ()
 

Private Attributes

absl::Mutex mu_
 
std::vector< std::thread > threads_
 

Detailed Description

Definition at line 32 of file thread_pool.h.

Constructor & Destructor Documentation

◆ ThreadPool() [1/2]

absl::synchronization_internal::ThreadPool::ThreadPool ( int  num_threads)
inlineexplicit

Definition at line 34 of file thread_pool.h.

◆ ThreadPool() [2/2]

absl::synchronization_internal::ThreadPool::ThreadPool ( const ThreadPool )
delete

◆ ~ThreadPool()

absl::synchronization_internal::ThreadPool::~ThreadPool ( )
inline

Definition at line 43 of file thread_pool.h.

Member Function Documentation

◆ GUARDED_BY()

std::queue<std::function<void()> > queue_ absl::synchronization_internal::ThreadPool::GUARDED_BY ( mu_  )
private

◆ operator=()

ThreadPool& absl::synchronization_internal::ThreadPool::operator= ( const ThreadPool )
delete

◆ Schedule()

void absl::synchronization_internal::ThreadPool::Schedule ( std::function< void()>  func)
inline

Definition at line 56 of file thread_pool.h.

◆ WorkAvailable()

bool absl::synchronization_internal::ThreadPool::WorkAvailable ( ) const
inlineprivate

Definition at line 63 of file thread_pool.h.

◆ WorkLoop()

void absl::synchronization_internal::ThreadPool::WorkLoop ( )
inlineprivate

Definition at line 67 of file thread_pool.h.

Member Data Documentation

◆ mu_

absl::Mutex absl::synchronization_internal::ThreadPool::mu_
private

Definition at line 83 of file thread_pool.h.

◆ threads_

std::vector<std::thread> absl::synchronization_internal::ThreadPool::threads_
private

Definition at line 85 of file thread_pool.h.


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


abseil_cpp
Author(s):
autogenerated on Mon Feb 28 2022 21:31:23