Service_Gestalt.cpp File Reference

#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"
Include dependency graph for Service_Gestalt.cpp:

Go to the source code of this file.

Functions

 ACE_RCSID (ace, Service_Gestalt,"$Id: Service_Gestalt.cpp 84854 2009-03-16 19:38:57Z msmit $") 1 ACE_Service_Type_Dynamic_Guard

Function Documentation

ACE_RCSID ( ace  ,
Service_Gestalt  ,
"$Id: Service_Gestalt.cpp 84854 2009-03-16 19:38:57Z msmit $"   
)

Definition at line 32 of file Service_Gestalt.cpp.

00034                : Service_Gestalt.cpp 84854 2009-03-16 19:38:57Z msmit $")
00035 
00036 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
00037 
00038 ACE_Service_Type_Dynamic_Guard::ACE_Service_Type_Dynamic_Guard
00039   (ACE_Service_Repository &r, const ACE_TCHAR *name)
00040     : repo_ (r)
00041     // Relocation starts where the next service will be inserted (if any)
00042     , repo_begin_ (r.current_size ())
00043     , name_ (name)
00044 # if defined (ACE_MT_SAFE) && (ACE_MT_SAFE != 0)
00045   // On this thread (for the duration of the initialize() method),
00046   // we're about to do two things that require locking: (1) fiddle
00047   // with the repository and (2) load a DLL and hence lock the
00048   // DLL_Manager.
00049   //
00050   // Now if we don't lock the repo here, it is possible that two
00051   // threads may deadlock on initialization because they can acquire
00052   // locks (1) and (2) in different order, for instance:
00053   //
00054   // T1: loads a DLL (2) and registers a service (1);
00055   //
00056   // T2: may be relocating a service (1), which could lead to a
00057   // (re)opening or uping the ref count on a DLL (2);
00058   //
00059   // To prevent this, we lock the repo here, using the repo_monitor_
00060   // member guard.
00061     , repo_monitor_ (r.lock_)
00062 #endif
00063 {
00064     if (ACE::debug ())
00065         ACE_DEBUG ((LM_DEBUG,
00066                     ACE_TEXT ("ACE (%P|%t) STDG::<ctor>, repo=%@")
00067                     ACE_TEXT(", name=%s - begining at [%d]\n"),
00068                     &this->repo_,
00069                     this->name_,
00070                     this->repo_begin_));
00071 
00072   ACE_ASSERT (this->name_ != 0); // No name?
00073 }

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on Fri Nov 6 23:17:46 2009 for ACE by  doxygen 1.6.1