version 1.123, 2006/07/26 20:34:00
|
version 1.123.2.1, 2006/07/27 23:11:51
|
|
|
| |
Uint32 max_threads_per_svc_queue; | Uint32 max_threads_per_svc_queue; |
| |
PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL |
ThreadReturnType PEGASUS_THREAD_CDECL |
MessageQueueService::kill_idle_threads(void *parm) | MessageQueueService::kill_idle_threads(void *parm) |
{ | { |
| |
|
|
} | } |
| |
#ifdef PEGASUS_POINTER_64BIT | #ifdef PEGASUS_POINTER_64BIT |
return (PEGASUS_THREAD_RETURN)(Uint64)dead_threads; |
return (ThreadReturnType)(Uint64)dead_threads; |
#elif PEGASUS_PLATFORM_AIX_RS_IBMCXX | #elif PEGASUS_PLATFORM_AIX_RS_IBMCXX |
return (PEGASUS_THREAD_RETURN)(unsigned long)dead_threads; |
return (ThreadReturnType)(unsigned long)dead_threads; |
#else | #else |
return (PEGASUS_THREAD_RETURN)(Uint32)dead_threads; |
return (ThreadReturnType)(Uint32)dead_threads; |
#endif | #endif |
} | } |
| |
PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL MessageQueueService::polling_routine(void *parm) |
ThreadReturnType PEGASUS_THREAD_CDECL MessageQueueService::polling_routine(void *parm) |
{ | { |
Thread *myself = reinterpret_cast<Thread *>(parm); | Thread *myself = reinterpret_cast<Thread *>(parm); |
List<MessageQueueService, RecursiveMutex> *list = |
List<MessageQueueService, Mutex> *list = |
reinterpret_cast<List<MessageQueueService, RecursiveMutex>*>(myself->get_parm()); |
reinterpret_cast<List<MessageQueueService, Mutex>*>(myself->get_parm()); |
| |
while (_stop_polling.get() == 0) | while (_stop_polling.get() == 0) |
{ | { |
|
|
service->_incoming.count(), | service->_incoming.count(), |
service->_threads.get()); | service->_threads.get()); |
| |
pegasus_yield(); |
Threads::yield(); |
service = NULL; | service = NULL; |
} | } |
} | } |
|
|
| |
} | } |
} | } |
myself->exit_self( (PEGASUS_THREAD_RETURN) 1 ); |
myself->exit_self( (ThreadReturnType) 1 ); |
return(0); | return(0); |
} | } |
| |
|
|
_mask(mask), | _mask(mask), |
_die(0), | _die(0), |
_threads(0), | _threads(0), |
_incoming(0), |
_incoming(), |
_incoming_queue_shutdown(0) | _incoming_queue_shutdown(0) |
{ | { |
| |
|
|
| |
while (_threads.get() > 0) | while (_threads.get() > 0) |
{ | { |
pegasus_yield(); |
Threads::yield(); |
} | } |
| |
{ | { |
|
|
} | } |
| |
| |
PEGASUS_THREAD_RETURN PEGASUS_THREAD_CDECL MessageQueueService::_req_proc( |
ThreadReturnType PEGASUS_THREAD_CDECL MessageQueueService::_req_proc( |
void * parm) | void * parm) |
{ | { |
MessageQueueService* service = | MessageQueueService* service = |
|
|
while ( (tr =_polling_thread->run()) != PEGASUS_THREAD_OK) | while ( (tr =_polling_thread->run()) != PEGASUS_THREAD_OK) |
{ | { |
if (tr == PEGASUS_THREAD_INSUFFICIENT_RESOURCES) | if (tr == PEGASUS_THREAD_INSUFFICIENT_RESOURCES) |
pegasus_yield(); |
Threads::yield(); |
else | else |
throw Exception(MessageLoaderParms("Common.MessageQueueService.NOT_ENOUGH_THREAD", | throw Exception(MessageLoaderParms("Common.MessageQueueService.NOT_ENOUGH_THREAD", |
"Could not allocate thread for the polling thread.")); | "Could not allocate thread for the polling thread.")); |
|
|
} // message processing loop | } // message processing loop |
| |
// shutdown the AsyncQueue | // shutdown the AsyncQueue |
service->_incoming.shutdown_queue(); |
service->_incoming.close(); |
return; | return; |
} | } |
| |