diff options
-rw-r--r-- | ACE/ace/Log_Category.cpp | 5 | ||||
-rw-r--r-- | ACE/ace/Log_Category.h | 2 | ||||
-rw-r--r-- | ACE/ace/Log_Msg.cpp | 1 | ||||
-rw-r--r-- | ACE/ace/Log_Msg.h | 2 | ||||
-rw-r--r-- | ACE/ace/Log_Record.h | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h | 1 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp | 22 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h | 12 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp | 72 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/LiveCheck.h | 15 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp | 19 | ||||
-rw-r--r-- | TAO/orbsvcs/ImplRepo_Service/Replicator.cpp | 2 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/README | 3 | ||||
-rw-r--r-- | TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp | 14 |
15 files changed, 93 insertions, 80 deletions
diff --git a/ACE/ace/Log_Category.cpp b/ACE/ace/Log_Category.cpp index f26e0be891c..98a2cc8585a 100644 --- a/ACE/ace/Log_Category.cpp +++ b/ACE/ace/Log_Category.cpp @@ -3,12 +3,10 @@ #include "ace/Atomic_Op.h" #include "ace/OS_NS_Thread.h" - #if !defined (__ACE_INLINE__) #include "ace/Log_Category.inl" #endif /* __ACE_INLINE__ */ - ACE_BEGIN_VERSIONED_NAMESPACE_DECL #if defined (ACE_HAS_THREADS) @@ -19,7 +17,6 @@ ACE_Log_Category_tss_destroy(void * p) } #endif // defined (ACE_HAS_THREADS) - ACE_Log_Category::ACE_Log_Category(const char* name) : name_(name) , id_(0) @@ -125,8 +122,6 @@ ACE_Log_Category::per_thr_obj() #endif // defined (ACE_HAS_THREADS) } - - ACE_Log_Category& ACE_Log_Category::ace_lib() { diff --git a/ACE/ace/Log_Category.h b/ACE/ace/Log_Category.h index 2f6c0c226be..a7f11a36078 100644 --- a/ACE/ace/Log_Category.h +++ b/ACE/ace/Log_Category.h @@ -282,7 +282,6 @@ public: /// Set the process ACE_Log_Priority mask, returns original mask. u_long priority_mask (u_long); - static ACE_Log_Category& ace_lib(); private: @@ -309,7 +308,6 @@ private: #endif // defined (ACE_HAS_THREADS) }; - ACE_END_VERSIONED_NAMESPACE_DECL #if defined (__ACE_INLINE__) diff --git a/ACE/ace/Log_Msg.cpp b/ACE/ace/Log_Msg.cpp index 190c6d7815d..60a034399d2 100644 --- a/ACE/ace/Log_Msg.cpp +++ b/ACE/ace/Log_Msg.cpp @@ -770,7 +770,6 @@ ACE_Log_Msg::cleanup_ostream () } // Open the sender-side of the message queue. - int ACE_Log_Msg::open (const ACE_TCHAR *prog_name, u_long flags, diff --git a/ACE/ace/Log_Msg.h b/ACE/ace/Log_Msg.h index 92c54cecbca..658da70e24b 100644 --- a/ACE/ace/Log_Msg.h +++ b/ACE/ace/Log_Msg.h @@ -411,7 +411,6 @@ public: * @note Be aware that because of the current architecture there is * no guarantee that open (), reset () and close () will be called * on a backend object. - * */ static ACE_Log_Msg_Backend *msg_backend (ACE_Log_Msg_Backend *b); static ACE_Log_Msg_Backend *msg_backend (void); @@ -767,7 +766,6 @@ private: ACE_Log_Msg (const ACE_Log_Msg &); }; - #ifdef ACE_LACKS_VA_FUNCTIONS class ACE_Time_Value; /// Alternative to varargs for formatting log messages. diff --git a/ACE/ace/Log_Record.h b/ACE/ace/Log_Record.h index 792384b9a73..0ace47d7fc9 100644 --- a/ACE/ace/Log_Record.h +++ b/ACE/ace/Log_Record.h @@ -69,7 +69,6 @@ public: /// Default dtor. ~ACE_Log_Record (void); - /// Write the contents of the logging record to the appropriate /// FILE if the corresponding type is enabled. int print (const ACE_TCHAR host_name[], diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h index c02044b617a..f5fa9b4d8ef 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncAccessManager.h @@ -119,7 +119,6 @@ typedef TAO_Intrusive_Ref_Count_Handle<AsyncAccessManager> AsyncAccessManager_pt * * @brief callback for handling asynch server startup requests */ - class ActivatorReceiver : public virtual POA_ImplementationRepository::AMI_ActivatorHandler { diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp index c538082bfb8..0934f68f194 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.cpp @@ -21,8 +21,7 @@ AsyncListManager::AsyncListManager (const Locator_Repository *repo, first_ (0), how_many_ (0), waiters_ (0), - refcount_ (1), - lock_ () + refcount_ (1) { } @@ -45,7 +44,7 @@ AsyncListManager::poa (void) void AsyncListManager::init_list (void) { - CORBA::ULong len = + CORBA::ULong const len = static_cast<CORBA::ULong> (this->repo_->servers ().current_size ()); Locator_Repository::SIMap::ENTRY* entry = 0; Locator_Repository::SIMap::CONST_ITERATOR it (this->repo_->servers ()); @@ -78,7 +77,7 @@ AsyncListManager::init_list (void) { if (!evaluate_status (i, l->status(), info->pid)) { - this->waiters_++; + ++this->waiters_; } else { @@ -310,14 +309,12 @@ AsyncListManager::ping_replied (CORBA::ULong index, LiveStatus status, int pid) { this->final_state (); } - return; } } AsyncListManager * AsyncListManager::_add_ref (void) { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); ++this->refcount_; return this; } @@ -325,11 +322,8 @@ AsyncListManager::_add_ref (void) void AsyncListManager::_remove_ref (void) { - int count = 0; - { - ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); - count = --this->refcount_; - } + int const count = --this->refcount_; + if (count == 0) { delete this; @@ -361,7 +355,7 @@ ListLiveListener::~ListLiveListener (void) bool ListLiveListener::start (void) { - bool rtn = this->pinger_.add_poll_listener (this); + bool const rtn = this->pinger_.add_poll_listener (this); this->started_ = true; return rtn; } @@ -389,7 +383,9 @@ ListLiveListener::status_changed (LiveStatus status) else { if (this->started_) - this->owner_->ping_replied (this->index_, status, this->pid_); + { + this->owner_->ping_replied (this->index_, status, this->pid_); + } } return true; } diff --git a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h index bd722dd71ca..101a0ceb880 100644 --- a/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h +++ b/TAO/orbsvcs/ImplRepo_Service/AsyncListManager.h @@ -19,6 +19,11 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Intrusive_Ref_Count_Handle_T.h" +#if defined (ACE_HAS_CPP11) +# include <atomic> +#else +# include "ace/Atomic_Op.h" +#endif /* ACE_HAS_CPP11 */ #include "LiveCheck.h" class Locator_Repository; @@ -73,8 +78,11 @@ class AsyncListManager CORBA::ULong first_; CORBA::ULong how_many_; CORBA::ULong waiters_; - int refcount_; - TAO_SYNCH_MUTEX lock_; +#if defined (ACE_HAS_CPP11) + std::atomic<int> refcount_; +#else + ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> refcount_; +#endif /* ACE_HAS_CPP11 */ }; typedef TAO_Intrusive_Ref_Count_Handle<AsyncListManager> AsyncListManager_ptr; diff --git a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp index 62f816fc231..83356ae9f9b 100644 --- a/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/ImR_Locator_i.cpp @@ -250,10 +250,12 @@ ImR_Locator_i::run (void) ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("Implementation Repository: Running\n") ACE_TEXT ("\tPing Interval : %dms\n") + ACE_TEXT ("\tPing Timeout : %dms\n") ACE_TEXT ("\tStartup Timeout : %ds\n") ACE_TEXT ("\tPersistence : %s\n") ACE_TEXT ("\tMulticast : %C\n"), this->opts_->ping_interval ().msec (), + this->opts_->ping_timeout ().msec (), this->opts_->startup_timeout ().sec (), this->repository_->repo_mode (), (this->repository_->multicast () != 0 ? diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp index b0136bee5bd..310e331b8a5 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.cpp @@ -12,8 +12,7 @@ LiveListener::LiveListener (const char *server) : server_ (server), - refcount_ (1), - lock_ () + refcount_ (1) { } @@ -30,13 +29,12 @@ LiveListener::server (void) const LiveListener * LiveListener::_add_ref (void) { - ACE_GUARD_RETURN (TAO_SYNCH_MUTEX, mon, this->lock_, 0); - ++this->refcount_; + int const refcount = ++this->refcount_; if (ImR_Locator_i::debug () > 5) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) LiveListener::add_ref <%C> count <%d>\n"), - server_.c_str(), refcount_)); + server_.c_str(), refcount)); } return this; } @@ -44,17 +42,13 @@ LiveListener::_add_ref (void) void LiveListener::_remove_ref (void) { - int count = 0; - { - ACE_GUARD (TAO_SYNCH_MUTEX, mon, this->lock_); - count = --this->refcount_; - if (ImR_Locator_i::debug () > 5) - { - ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) LiveListener::remove_ref <%C> count <%d>\n"), - server_.c_str(), count)); - } - } + int const count = --this->refcount_; + if (ImR_Locator_i::debug () > 5) + { + ORBSVCS_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) LiveListener::remove_ref <%C> count <%d>\n"), + server_.c_str(), count)); + } if (count == 0) { delete this; @@ -147,8 +141,8 @@ LiveEntry::LiveEntry (LiveCheck *owner, if (ImR_Locator_i::debug () > 4) { ORBSVCS_DEBUG ((LM_DEBUG, - ACE_TEXT ("(%P|%t) LiveEntry::ctor server <%C> may_ping <%d> pid <%d>\n"), - server, may_ping, pid)); + ACE_TEXT ("(%P|%t) LiveEntry::ctor server <%C> status <%C> may_ping <%d> pid <%d>\n"), + server, status_name (this->liveliness_), may_ping, pid)); } } @@ -231,8 +225,8 @@ LiveEntry::status (void) const return LS_ALIVE; } - if ( this->liveliness_ == LS_ALIVE && - this->owner_->ping_interval() != ACE_Time_Value::zero ) + if (this->liveliness_ == LS_ALIVE && + this->owner_->ping_interval() != ACE_Time_Value::zero) { ACE_Time_Value now (ACE_OS::gettimeofday()); if (now >= this->next_check_) @@ -338,6 +332,12 @@ LiveEntry::pid (void) const } bool +LiveEntry::may_ping (void) const +{ + return this->may_ping_; +} + +bool LiveEntry::has_pid (int pid) const { return this->pid_ == 0 || pid == 0 || pid == this->pid_; @@ -350,9 +350,9 @@ LiveEntry::validate_ping (bool &want_reping, ACE_Time_Value& next) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) LiveEntry::validate_ping, status ") - ACE_TEXT ("<%C> listeners <%d> server <%C> pid <%d>\n"), + ACE_TEXT ("<%C> listeners <%d> server <%C> pid <%d> want_reping <%d> may_ping <%d>\n"), status_name (this->liveliness_), this->listeners_.size (), - this->server_.c_str(), this->pid_)); + this->server_.c_str(), this->pid_, want_reping, this->may_ping_)); } if (this->liveliness_ == LS_PING_AWAY || @@ -458,6 +458,13 @@ LiveEntry::do_ping (PortableServer::POA_ptr poa) } try { + if (ImR_Locator_i::debug () > 3) + { + ORBSVCS_DEBUG ((LM_DEBUG, + ACE_TEXT ("(%P|%t) LiveEntry::do_ping, ") + ACE_TEXT ("starting sendc_ping for server <%C>\n"), + this->server_.c_str())); + } this->ref_->sendc_ping (cb.in()); if (ImR_Locator_i::debug () > 3) { @@ -473,16 +480,15 @@ LiveEntry::do_ping (PortableServer::POA_ptr poa) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) LiveEntry::do_ping, ") - ACE_TEXT ("sendc_ping for server <%C> threw <%C>\n"), - this->server_.c_str(), ex._name())); + ACE_TEXT ("sendc_ping for server <%C> threw <%C> marking as dead\n"), + this->server_.c_str(), ex._info ().c_str ())); } + this->release_callback (); this->status (LS_DEAD); } } //--------------------------------------------------------------------------- -//--------------------------------------------------------------------------- - PingReceiver::PingReceiver (LiveEntry *entry, PortableServer::POA_ptr poa) :poa_ (PortableServer::POA::_duplicate(poa)), entry_ (entry) @@ -520,7 +526,7 @@ PingReceiver::cancel (void) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) PingReceiver::cancel caught <%C>\n"), - ex._name ())); + ex._info ().c_str ())); } } } @@ -693,7 +699,7 @@ LiveCheck::LiveCheck () token_ (100), handle_timeout_busy_ (0), want_timeout_ (false), - deferred_timeout_ (0,0) + deferred_timeout_ (ACE_Time_Value::zero) { } @@ -798,8 +804,8 @@ LiveCheck::handle_timeout (const ACE_Time_Value &, { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) LiveCheck::handle_timeout(%d)") - ACE_TEXT (", ping skipped for server <%C>\n"), - token, entry->server_name ())); + ACE_TEXT (", ping skipped for server <%C> may_ping <%d>\n"), + token, entry->server_name (), entry->may_ping ())); } } } @@ -847,8 +853,8 @@ LiveCheck::add_server (const char *server, { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) LiveCheck::add_server <%C> ") - ACE_TEXT ("running <%d> pid <%d>\n"), - server, this->running_, pid)); + ACE_TEXT ("may_ping <%d> running <%d> pid <%d>\n"), + server, may_ping, this->running_, pid)); } if (!this->running_) @@ -1192,7 +1198,7 @@ LiveCheck::schedule_ping (LiveEntry *entry) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) LiveCheck::schedule_ping (%d),") - ACE_TEXT (" delay = %d,%d\n"), + ACE_TEXT (" delay <%d,%d>\n"), this->token_, delay.sec(), delay.usec())); } this->reactor()->schedule_timer (this, diff --git a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h index fa9daf3c5ce..6437f7c289c 100644 --- a/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h +++ b/TAO/orbsvcs/ImplRepo_Service/LiveCheck.h @@ -22,6 +22,11 @@ #endif /* ACE_LACKS_PRAGMA_ONCE */ #include "tao/Intrusive_Ref_Count_Handle_T.h" +#if defined (ACE_HAS_CPP11) +# include <atomic> +#else +# include "ace/Atomic_Op.h" +#endif /* ACE_HAS_CPP11 */ class LiveCheck; class LiveEntry; @@ -81,7 +86,7 @@ class Locator_Export LiveListener /// is received. Returns true if finished listening virtual bool status_changed (LiveStatus status) = 0; - /// accessor for the server name. Used by the LiveCheck to associate a listener + /// Accessor for the server name. Used by the LiveCheck to associate a listener const char *server (void) const; LiveListener *_add_ref (void); @@ -91,8 +96,11 @@ class Locator_Export LiveListener ACE_CString server_; private: - int refcount_; - TAO_SYNCH_MUTEX lock_; +#if defined (ACE_HAS_CPP11) + std::atomic<int> refcount_; +#else + ACE_Atomic_Op<TAO_SYNCH_MUTEX, int> refcount_; +#endif /* ACE_HAS_CPP11 */ }; typedef TAO_Intrusive_Ref_Count_Handle<LiveListener> LiveListener_ptr; @@ -140,6 +148,7 @@ class Locator_Export LiveEntry void set_pid (int pid); bool has_pid (int pid) const; int pid (void) const; + bool may_ping (void) const; private: LiveCheck *owner_; diff --git a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp index 4f66897ae24..d691b4e8495 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/Locator_Options.cpp @@ -10,6 +10,7 @@ #include "ace/Arg_Shifter.h" #include "orbsvcs/Log_Macros.h" #include "ace/OS_NS_strings.h" +#include "ace/OS_NS_time.h" #if defined (ACE_WIN32) static const HKEY SERVICE_REG_ROOT = HKEY_LOCAL_MACHINE; @@ -261,7 +262,7 @@ Options::parse_args (int &argc, ACE_TCHAR *argv[]) return -1; } this->ping_interval_ = - ACE_Time_Value (0, 1000 * ACE_OS::atoi (shifter.get_current ())); + ACE_Time_Value (0, ACE_U_ONE_SECOND_IN_MSECS * ACE_OS::atoi (shifter.get_current ())); } else if (ACE_OS::strcasecmp (shifter.get_current (), ACE_TEXT ("-n")) == 0) @@ -276,7 +277,7 @@ Options::parse_args (int &argc, ACE_TCHAR *argv[]) return -1; } this->ping_timeout_ = - ACE_Time_Value (0, 1000 * ACE_OS::atoi (shifter.get_current ())); + ACE_Time_Value (0, ACE_U_ONE_SECOND_IN_MSECS * ACE_OS::atoi (shifter.get_current ())); } else if (ACE_OS::strcasecmp (shifter.get_current (), ACE_TEXT ("--ftendpoint")) == 0) @@ -305,7 +306,7 @@ Options::parse_args (int &argc, ACE_TCHAR *argv[]) return -1; } this->ft_update_delay_ = - ACE_Time_Value (0, 1000 * ACE_OS::atoi (shifter.get_current ())); + ACE_Time_Value (0, ACE_U_ONE_SECOND_IN_MSECS * ACE_OS::atoi (shifter.get_current ())); } else { @@ -388,14 +389,16 @@ Options::print_usage (void) const ACE_TEXT (" --backup Replicate the ImplRepo as the backup ImR\n") ACE_TEXT (" -r Use the registry for storing/loading settings\n") ACE_TEXT (" -s Run as a service\n") - ACE_TEXT (" -t secs Server startup timeout.(Default = 60s)\n") - ACE_TEXT (" -v msecs Server verification interval.(Default = 10000ms)\n") - ACE_TEXT (" -n msecs Ping request timeout.(Default = 10ms)\n") + ACE_TEXT (" -t secs Server startup timeout.(Default = %ds)\n") + ACE_TEXT (" -v msecs Server verification interval.(Default = %dms)\n") + ACE_TEXT (" -n msecs Ping request timeout.(Default = %dms)\n") ACE_TEXT (" -i Ping servers started without activators too.\n") ACE_TEXT (" --lockout Prevent excessive restart attempts until manual reset.\n") ACE_TEXT (" --UnregisterIfAddressReused,\n") - ACE_TEXT (" -u Unregister server if its endpoint is used by another\n") - )); + ACE_TEXT (" -u Unregister server if its endpoint is used by another\n"), + DEFAULT_START_TIMEOUT, + DEFAULT_PING_INTERVAL * ACE_U_ONE_SECOND_IN_MSECS, + DEFAULT_PING_TIMEOUT * ACE_U_ONE_SECOND_IN_MSECS)); } int diff --git a/TAO/orbsvcs/ImplRepo_Service/Replicator.cpp b/TAO/orbsvcs/ImplRepo_Service/Replicator.cpp index dc4017895ee..aeb716fbab3 100644 --- a/TAO/orbsvcs/ImplRepo_Service/Replicator.cpp +++ b/TAO/orbsvcs/ImplRepo_Service/Replicator.cpp @@ -157,7 +157,7 @@ Replicator::svc (void) { ORBSVCS_DEBUG ((LM_DEBUG, ACE_TEXT ("(%P|%t) Replicator::svc caught %C\n"), - ex._name ())); + ex._info ().c_str ())); } } return 0; diff --git a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/README b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/README index 28ac5a5d6c8..ec2741de70b 100644 --- a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/README +++ b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/README @@ -11,3 +11,6 @@ interrogates for judging success. Runtime options are -debug to turn on verbose debugging to separate log files and -no_dns, which forces the use of 127.0.0.1 in endpoints for running in environments in which DNS is not properly configured. + +This test has been extended with a test to make sure the ImR works when there is +a delay between the process startup and the creation of the POA diff --git a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp index bb9d613f201..45a56ca1902 100644 --- a/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp +++ b/TAO/orbsvcs/tests/ImplRepo/Bug_4152_Regression/server.cpp @@ -15,7 +15,7 @@ class ORB_Runner : public ACE_Task_Base { public: - ORB_Runner (CORBA::ORB_ptr orb) : orb_(CORBA::ORB::_duplicate(orb)) {} + explicit ORB_Runner (CORBA::ORB_ptr orb) : orb_(CORBA::ORB::_duplicate(orb)) {} int svc (void) { this->orb_->run (); @@ -110,7 +110,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) Test_var tva = Test::_narrow (obj.in()); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Started Server pid <%d> poa delay <%d> shutdown delay <%d>\n", ACE_OS::getpid (), poa_delay, shutdown_delay)); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Started Server pid <%P> poa delay <%d> shutdown delay <%d>\n", poa_delay, shutdown_delay)); { ACE_CString status_file = base + ACE_CString(".status"); @@ -122,11 +122,10 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) out << ACE_OS::getpid () << endl; out.close (); } - ACE_Time_Value tv (poa_delay); - ACE_OS::sleep (tv); + ACE_OS::sleep (poa_delay); activatePOAs (); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Activated POA pid <%d>\n", ACE_OS::getpid ())); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Activated POA pid <%P>\n")); TAO_Root_POA* tpoa = dynamic_cast<TAO_Root_POA*> (poa_a.in ()); ACE_ASSERT (tpoa != 0); @@ -144,7 +143,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) runner->wait (); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Destroying POA pid <%d>\n", ACE_OS::getpid ())); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Destroying POA pid <%P>\n")); root_poa->destroy(1,1); orb->destroy(); @@ -160,8 +159,7 @@ ACE_TMAIN (int argc, ACE_TCHAR *argv[]) ACE_OS::sleep (shutdown_delay); - ACE_DEBUG ((LM_DEBUG, "(%P|%t) Exiting Server pid = %d \n", - ACE_OS::getpid ())); + ACE_DEBUG ((LM_DEBUG, "(%P|%t) Exiting Server pid <%P>\n")); return 0; } |