JUCE: ThreadPoolOptions Struct Reference

JUCE

- Main Page
- Related Pages
- Modules
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
ThreadPoolOptions Struct Reference
juce_core » threads

A set of threads that will run a list of jobs. More...

`#include <juce_ThreadPool.h>`

## Public Member Functions
ThreadPoolOptions | withThreadName (String newThreadName) const
| The name to give each thread in the pool.
ThreadPoolOptions | withNumberOfThreads (int newNumberOfThreads) const
| The number of threads to run.
ThreadPoolOptions | withThreadStackSizeBytes (size_t newThreadStackSizeBytes) const
| The size of the stack of each thread in the pool.
ThreadPoolOptions | withDesiredThreadPriority (Thread::Priority newDesiredThreadPriority) const
| The desired priority of each thread in the pool.

## Public Attributes
String | threadName { "Pool" }
int | numberOfThreads { SystemStats::getNumCpus() }
size_t | threadStackSizeBytes { Thread::osDefaultStackSize }
Thread::Priority | desiredThreadPriority { Thread::Priority::normal }

## Detailed Description

A set of threads that will run a list of jobs.

When a ThreadPoolJob object is added to the ThreadPool's list, its runJob() method will be called by the next pooled thread that becomes free.

See also
  ThreadPoolJob, Thread

## Member Function Documentation

## ◆ withThreadName()

ThreadPoolOptions ThreadPoolOptions::withThreadName | ( | String | newThreadName | ) | const

The name to give each thread in the pool.

References threadName, and withMember().

## ◆ withNumberOfThreads()

ThreadPoolOptions ThreadPoolOptions::withNumberOfThreads | ( | int | newNumberOfThreads | ) | const

The number of threads to run.

These will be started when a pool is created, and run until the pool is destroyed.

References numberOfThreads, and withMember().

## ◆ withThreadStackSizeBytes()

ThreadPoolOptions ThreadPoolOptions::withThreadStackSizeBytes | ( | size_t | newThreadStackSizeBytes | ) | const

The size of the stack of each thread in the pool.

References threadStackSizeBytes, and withMember().

## ◆ withDesiredThreadPriority()

ThreadPoolOptions ThreadPoolOptions::withDesiredThreadPriority | ( | Thread::Priority | newDesiredThreadPriority | ) | const

The desired priority of each thread in the pool.

References desiredThreadPriority, and withMember().

## Member Data Documentation

## ◆ threadName

String ThreadPoolOptions::threadName { "Pool" }

Referenced by withThreadName().

## ◆ numberOfThreads

int ThreadPoolOptions::numberOfThreads { SystemStats::getNumCpus() }

Referenced by withNumberOfThreads().

## ◆ threadStackSizeBytes

size_t ThreadPoolOptions::threadStackSizeBytes { Thread::osDefaultStackSize }

Referenced by withThreadStackSizeBytes().

## ◆ desiredThreadPriority

Thread::Priority ThreadPoolOptions::desiredThreadPriority { Thread::Priority::normal }

Referenced by withDesiredThreadPriority().

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

- juce_ThreadPool.h