version 1.2, 2006/08/09 21:12:42
|
version 1.3, 2006/11/10 18:14:58
|
|
|
// | // |
//============================================================================== | //============================================================================== |
// | // |
// Author: Mike Day (mdday@us.ibm.com) |
|
// |
|
// Modified By: Markus Mueller |
|
// Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com) |
|
// Amit K Arora, IBM (amita@in.ibm.com) for PEP#101 |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
|
// Sean Keenan, Hewlett-Packard Company (sean.keenan@hp.com) |
|
// Josephine Eskaline Joyce, IBM (jojustin@in.ibm.com) for Bug#2393 |
|
// |
|
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
#ifndef Pegasus_ThreadPool_h | #ifndef Pegasus_ThreadPool_h |
|
|
@param deallocateWait The minimum time that a thread should be idle | @param deallocateWait The minimum time that a thread should be idle |
before it is removed from the pool and cleaned up. | before it is removed from the pool and cleaned up. |
*/ | */ |
ThreadPool(Sint16 initialSize, |
ThreadPool( |
|
Sint16 initialSize, |
const char *key, | const char *key, |
Sint16 minThreads, | Sint16 minThreads, |
Sint16 maxThreads, struct timeval &deallocateWait); |
Sint16 maxThreads, |
|
struct timeval& deallocateWait); |
| |
/** | /** |
Destructs the ThreadPool object. | Destructs the ThreadPool object. |
|
|
be allocated. | be allocated. |
@exception IPCException | @exception IPCException |
*/ | */ |
ThreadStatus allocate_and_awaken(void *parm, |
ThreadStatus allocate_and_awaken( |
ThreadReturnType(PEGASUS_THREAD_CDECL * |
void* parm, |
work) (void *), |
ThreadReturnType(PEGASUS_THREAD_CDECL* work) (void*), |
Semaphore * blocking = 0); | Semaphore * blocking = 0); |
| |
/** | /** |
|
|
| |
static ThreadReturnType PEGASUS_THREAD_CDECL _loop(void *); | static ThreadReturnType PEGASUS_THREAD_CDECL _loop(void *); |
| |
static Boolean _timeIntervalExpired(struct timeval *start, |
static Boolean _timeIntervalExpired( |
|
struct timeval* start, |
struct timeval *interval); | struct timeval *interval); |
| |
static void _deleteSemaphore(void *p); | static void _deleteSemaphore(void *p); |