ASL
Loading...
Searching...
No Matches
ThreadGroup< Thread > Class Template Reference

Detailed Description

template<class Thread>
class asl::ThreadGroup< Thread >

A ThreadGroup is a set of threads that start at the same time and can be waited for termination.

experimental and deprecated API**

In this example there is an array of tasks to do. Each Worker is a thread that performs a subset of the tasks: one does the first half and the other the second half.

threads << Worker(tasks.slice(0, tasks.length()/2));
threads << Worker(tasks.slice(tasks.length()/2, tasks.length()));
threads.start();
threads.join();
An Array is a contiguous and resizable array of any type of elements.
Definition Array.h:69
Array slice(int i1, int i2=0) const
Returns a section of the array, from element i1 up to but not including element i2; If i2 is omitted ...
Definition Array.h:440
int length() const
Returns the number of elements in the array.
Definition Array.h:171
String join(const String &sep) const
Returns a string representation of the array, formed by joining its elements with the given separator...
Definition String.h:710
Deprecated:

#include <Thread.h>


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