summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 04:28:11 +0000
committerlevine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>1998-11-30 04:28:11 +0000
commit59df40b607ce67ad66d0fcf66c754c35afeafb16 (patch)
treee510846b29102b441b3268fde18446a52b967a97
parentda8e2f9a1e06852078f2ae91b47e7a4bbce8529e (diff)
downloadATCD-59df40b607ce67ad66d0fcf66c754c35afeafb16.tar.gz
added ACE_OS::exit () recommendations in comments
-rw-r--r--ace/Object_Manager.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/ace/Object_Manager.h b/ace/Object_Manager.h
index 81a29c7b6e9..7c13d6efb34 100644
--- a/ace/Object_Manager.h
+++ b/ace/Object_Manager.h
@@ -237,6 +237,27 @@ class ACE_Export ACE_Object_Manager : public ACE_Object_Manager_Base
// cleaned up by the Object_Manager, they'll get cleaned up too
// late. The ACE tests do not violate this requirement.
// However, applications may have trouble with it.
+ //
+ // NOTE on the use of ::exit (): ::exit () does not destroy
+ // static objects. Therefore, if
+ // ACE_HAS_NONSTATIC_OBJECT_MANAGER is enabled, the
+ // ACE_Object_Manager instance will *not* be destroyed if ::exit
+ // () is called! However, ACE_OS::exit () will properly destroy
+ // the ACE_Object_Manager. It is highly recommended that
+ // ACE_OS::exit () be used instead of ::exit ().
+ //
+ // However, ::exit () and ACE_OS::exit () are tricky to use
+ // properly, especially in multithread programs. It is much
+ // safer to throw an exception (or simulate that effect) that
+ // will be caught by main () instead of calling exit. Then,
+ // main () can perform any necessary application-specific
+ // cleanup and return the status value. In addition, it's
+ // usually best to avoid calling ::exit () and ACE_OS::exit ()
+ // from threads other than the main thread. Thanks to Jeff
+ // Greif <jmg@trivida.com> for pointing out that ::exit ()
+ // doesn't destroy automatic objects, and for developing the
+ // recommendations in this paragraph.
+
public:
static int init (void);
// Explicity initialize (construct the singleton instance of) the