diff options
Diffstat (limited to 'TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.cpp')
-rw-r--r-- | TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.cpp | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.cpp b/TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.cpp deleted file mode 100644 index c09255b1ae2..00000000000 --- a/TAO/performance-tests/CSD_Strategy/TestInf/ClientTask.cpp +++ /dev/null @@ -1,117 +0,0 @@ -// $Id$ -// This may look like C, but it's really -*- C++ -*- -#include "ClientTask.h" -#include "tao/Exception.h" -#include "ace/SString.h" - - -ClientTask::ClientTask() - : failure_count_(0), - num_loops_(1) -{ -} - - -ClientTask::~ClientTask() -{ -} - - -void -ClientTask::add_engine(ClientEngine* engine) -{ - // Pass in false so that _add_ref() is called. - ClientEngine_Handle engine_handle(engine,false); - this->engines_.push_back(engine_handle); -} - - -void -ClientTask::num_loops(unsigned num_loops) -{ - this->num_loops_ = num_loops; -} - - -int -ClientTask::open(void*) -{ - size_t num_threads = this->engines_.size(); - - if (num_threads == 0) - { - ACE_ERROR_RETURN((LM_ERROR, - "(%P|%t) ClientTask cannot activate 0 threads.\n"), - -1); - } - - if (this->activate(THR_NEW_LWP | THR_JOINABLE, num_threads) != 0) - { - // Assumes that when activate returns non-zero return code that - // no threads were activated. - ACE_ERROR_RETURN((LM_ERROR, - "(%P|%t) ClientTask failed to activate " - "the %d client threads.\n", num_threads), - -1); - } - - return 0; -} - - -int -ClientTask::svc() -{ - ClientEngine_Handle engine; - unsigned num_loops; - - { - GuardType guard(this->lock_); - this->engines_.get(engine, this->engines_.size() - 1); - this->engines_.pop_back(); - num_loops = this->num_loops_; - } - - ACE_TRY_NEW_ENV - { - if (engine->execute(num_loops ACE_ENV_ARG_PARAMETER) == false) - { - GuardType guard(this->lock_); - this->failure_count_++; - } - ACE_TRY_CHECK; - } - ACE_CATCHANY - { - ACE_PRINT_EXCEPTION (ACE_ANY_EXCEPTION, - "ClientTask::svc Caught exception from execute():"); - - GuardType guard(this->lock_); - this->failure_count_ ++; - } - ACE_CATCHALL - { - ACE_ERROR((LM_ERROR, - "(%P|%t) ClientTask::svc caught unknown (...) exception "\ - "in execute() " )); - GuardType guard(this->lock_); - this->failure_count_++; - } - ACE_ENDTRY; - - return 0; -} - - -int -ClientTask::close(u_long) -{ - return 0; -} - - -unsigned -ClientTask::failure_count() const -{ - return this->failure_count_; -} |