version 1.67, 2005/05/06 21:44:28
|
version 1.68, 2005/06/24 19:34:26
|
|
|
request->op->processing(); | request->op->processing(); |
| |
_incomingQueue.enqueue(request->op); | _incomingQueue.enqueue(request->op); |
|
ThreadStatus rtn = PEGASUS_THREAD_OK; |
while (!_thread_pool->allocate_and_awaken( |
while (( rtn =_thread_pool->allocate_and_awaken( |
(void *)this, ProviderManagerService::handleCimOperation)) |
(void *)this, ProviderManagerService::handleCimOperation)) != PEGASUS_THREAD_OK) |
{ | { |
|
if (rtn==PEGASUS_THREAD_INSUFFICIENT_RESOURCES) |
pegasus_yield(); | pegasus_yield(); |
|
else |
|
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"Not enough threads to service provider manager." ); |
|
|
|
Tracer::trace(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
|
"Could not allocate thread for %s.", |
|
getQueueName()); |
|
} |
} | } |
} | } |
else | else |
|
|
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, |
"ProviderManagerService::unloadIdleProviders"); | "ProviderManagerService::unloadIdleProviders"); |
|
ThreadStatus rtn = PEGASUS_THREAD_OK; |
// Ensure that only one _unloadIdleProvidersHandler thread runs at a time | // Ensure that only one _unloadIdleProvidersHandler thread runs at a time |
_unloadIdleProvidersBusy++; | _unloadIdleProvidersBusy++; |
if ((_unloadIdleProvidersBusy.value() == 1) && | if ((_unloadIdleProvidersBusy.value() == 1) && |
(_thread_pool->allocate_and_awaken( |
((rtn = _thread_pool->allocate_and_awaken( |
(void*)this, ProviderManagerService::_unloadIdleProvidersHandler))) |
(void*)this, ProviderManagerService::_unloadIdleProvidersHandler))==PEGASUS_THREAD_OK)) |
{ | { |
// _unloadIdleProvidersBusy is decremented in | // _unloadIdleProvidersBusy is decremented in |
// _unloadIdleProvidersHandler | // _unloadIdleProvidersHandler |
|
|
// If we fail to allocate a thread, don't retry now. | // If we fail to allocate a thread, don't retry now. |
_unloadIdleProvidersBusy--; | _unloadIdleProvidersBusy--; |
} | } |
|
if (rtn != PEGASUS_THREAD_OK) |
|
{ |
|
Logger::put(Logger::STANDARD_LOG, System::CIMSERVER, Logger::TRACE, |
|
"Not enough threads to unload idle providers."); |
| |
|
Tracer::trace(TRC_PROVIDERMANAGER, Tracer::LEVEL2, |
|
"Could not allocate thread for %s to unload idle providers.", |
|
getQueueName()); |
|
} |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |