diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/Init_ACE.cpp | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/Init_ACE.cpp')
-rw-r--r-- | ACE/ace/Init_ACE.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/ACE/ace/Init_ACE.cpp b/ACE/ace/Init_ACE.cpp new file mode 100644 index 00000000000..f997c09d4f8 --- /dev/null +++ b/ACE/ace/Init_ACE.cpp @@ -0,0 +1,45 @@ +#include "ace/Init_ACE.h" + +#include "ace/Object_Manager.h" + +ACE_RCSID (ace, + Init_ACE, + "$Id$") + + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL + +unsigned int ACE::init_fini_count_ = 0; + +int +ACE::init (void) +{ + // Don't use ACE_TRACE, because Object_Manager might not have been + // instantiated yet. + // ACE_TRACE ("ACE::init"); + + ++ACE::init_fini_count_; + + return ACE_Object_Manager::instance ()->init (); +} + +int +ACE::fini (void) +{ + ACE_TRACE ("ACE::fini"); + + if (ACE::init_fini_count_ > 0) + { + if (--ACE::init_fini_count_ == 0) + return ACE_Object_Manager::instance ()->fini (); + else + // Wait for remaining fini () calls. + return 1; + } + else + // More ACE::fini () calls than ACE::init () calls. Bad + // application! + return -1; +} + +ACE_END_VERSIONED_NAMESPACE_DECL |