#include "ace/Svc_Conf.h"
#include "ace/Get_Opt.h"
#include "ace/ARGV.h"
#include "ace/Malloc.h"
#include "ace/Service_Manager.h"
#include "ace/Service_Types.h"
#include "ace/Containers.h"
#include "ace/Auto_Ptr.h"
#include "ace/Reactor.h"
#include "ace/Thread_Manager.h"
#include "ace/DLL.h"
#include "ace/XML_Svc_Conf.h"
#include "ace/SString.h"
#include "ace/Signal.h"
#include "ace/OS_NS_stdio.h"
#include "ace/OS_NS_string.h"
#include "ace/OS_NS_time.h"
#include "ace/OS_NS_unistd.h"
#include "ace/OS_NS_sys_stat.h"
#include "ace/TSS_T.h"
#include "ace/Service_Gestalt.h"
#include "ace/Svc_Conf_Param.h"
Go to the source code of this file.
Functions | |
ACE_RCSID (ace, Service_Gestalt,"$Id: Service_Gestalt.cpp 91158 2010-07-21 15:54:12Z mesnier_p $") 1 ACE_Service_Type_Dynamic_Guard |
ACE_RCSID | ( | ace | , | |
Service_Gestalt | , | |||
"$Id: Service_Gestalt.cpp 91158 2010-07-21 15:54:12Z mesnier_p $" | ||||
) |
Definition at line 32 of file Service_Gestalt.cpp.
: Service_Gestalt.cpp 91158 2010-07-21 15:54:12Z mesnier_p $") ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_Service_Type_Dynamic_Guard::ACE_Service_Type_Dynamic_Guard (ACE_Service_Repository &r, const ACE_TCHAR *name) : repo_ (r) // Relocation starts where the next service will be inserted (if any) , repo_begin_ (r.current_size ()) , name_ (name) # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0) // On this thread (for the duration of the initialize() method), // we're about to do two things that require locking: (1) fiddle // with the repository and (2) load a DLL and hence lock the // DLL_Manager. // // Now if we don't lock the repo here, it is possible that two // threads may deadlock on initialization because they can acquire // locks (1) and (2) in different order, for instance: // // T1: loads a DLL (2) and registers a service (1); // // T2: may be relocating a service (1), which could lead to a // (re)opening or uping the ref count on a DLL (2); // // To prevent this, we lock the repo here, using the repo_monitor_ // member guard. , repo_monitor_ (r.lock_) #endif { if (ACE::debug ()) ACE_DEBUG ((LM_DEBUG, ACE_TEXT ("ACE (%P|%t) STDG::<ctor>, repo=%@") ACE_TEXT(", name=%s - begining at [%d]\n"), &this->repo_, this->name_, this->repo_begin_)); ACE_ASSERT (this->name_ != 0); // No name? }