version 1.54, 2002/06/07 00:56:00
|
version 1.55, 2002/06/07 15:17:13
|
|
|
AtomicInt MessageQueueService::_xid(1); | AtomicInt MessageQueueService::_xid(1); |
Mutex MessageQueueService::_meta_dispatcher_mutex; | Mutex MessageQueueService::_meta_dispatcher_mutex; |
| |
static struct timeval create_time = {0, 100}; |
static struct timeval create_time = {0, 10}; |
static struct timeval destroy_time = {1, 0}; |
static struct timeval destroy_time = {5, 0}; |
static struct timeval deadlock_time = {10, 0}; |
static struct timeval deadlock_time = {100, 0}; |
| |
ThreadPool MessageQueueService::_thread_pool(2, "MessageQueueService", 2, 20, |
ThreadPool *MessageQueueService::_thread_pool = 0; |
create_time, destroy_time, deadlock_time); |
|
| |
DQueue<MessageQueueService> MessageQueueService::_polling_list(true); | DQueue<MessageQueueService> MessageQueueService::_polling_list(true); |
| |
|
|
if( now.tv_sec - last.tv_sec > 0 ) | if( now.tv_sec - last.tv_sec > 0 ) |
{ | { |
gettimeofday(&last, NULL); | gettimeofday(&last, NULL); |
return _thread_pool.kill_dead_threads(); |
return _thread_pool->kill_dead_threads(); |
} | } |
return 0; | return 0; |
} | } |
|
|
{ | { |
if(service->_incoming.count() > 0 ) | if(service->_incoming.count() > 0 ) |
{ | { |
_thread_pool.allocate_and_awaken(service, _req_proc); |
_thread_pool->allocate_and_awaken(service, _req_proc); |
| |
// service->_req_proc(service); | // service->_req_proc(service); |
} | } |
|
|
_meta_dispatcher_mutex.unlock(); | _meta_dispatcher_mutex.unlock(); |
throw NullPointer(); | throw NullPointer(); |
} | } |
|
_thread_pool = new ThreadPool(0, "MessageQueueService", 0, 20, |
|
create_time, destroy_time, deadlock_time); |
_polling_thread.run(); | _polling_thread.run(); |
} | } |
_service_count++; | _service_count++; |