Differences From Artifact [7a259d1129]:
- File src/OFThreadPool.h — part of check-in [420e3c09c6] at 2012-03-21 10:45:36 on branch trunk — Add OFThreadPool. (user: js, size: 3409) [annotate] [blame] [check-ins using]
To Artifact [2701771c31]:
- File
src/OFThreadPool.h
— part of check-in
[4ac1256458]
at
2012-03-21 15:39:31
on branch trunk
— OFThreadPool: Terminate threads on deallocation.
Threads will not terminate instantly, but after finishing their current
job. (user: js, size: 3561) [annotate] [blame] [check-ins using] [more...]
| ︙ | ︙ | |||
23 24 25 26 27 28 29 30 31 32 33 34 |
@class OFMutableArray;
@class OFList;
@class OFCondition;
@class OFThreadPoolJob;
/**
* \brief A class providing a pool of reusable threads.
*/
@interface OFThreadPool: OFObject
{
size_t size;
OFMutableArray *threads;
| > > > | | | 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
@class OFMutableArray;
@class OFList;
@class OFCondition;
@class OFThreadPoolJob;
/**
* \brief A class providing a pool of reusable threads.
*
* \note When the thread pool is released, all threads will terminate after
* they finish the job they are currently processing.
*/
@interface OFThreadPool: OFObject
{
size_t size;
OFMutableArray *threads;
volatile int count;
@public
OFList *queue;
OFCondition *queueCondition;
volatile int doneCount;
OFCondition *countCondition;
}
/**
* \brief Returns a new thread pool with one thread for each core in the system.
*
* \warning If for some reason the number of cores in the system could not be
|
| ︙ | ︙ |