diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-31 21:01:14 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1996-12-31 21:01:14 +0000 |
commit | d6ae1a1ed58cb8f66e7f0c90801d01b7dae210f0 (patch) | |
tree | 0d582269360c3076865780bbe3c4d74d5d1d8eee | |
parent | e326fdabb2ca9dfe8e0201cf5fb1fceb9005a7a4 (diff) | |
download | ATCD-d6ae1a1ed58cb8f66e7f0c90801d01b7dae210f0.tar.gz |
added comments that try to explain ACE_Task_Exit
-rw-r--r-- | ace/Task.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/ace/Task.cpp b/ace/Task.cpp index ab6604fc115..a7626f52983 100644 --- a/ace/Task.cpp +++ b/ace/Task.cpp @@ -218,6 +218,28 @@ ACE_Task_Base::activate (long flags, // Note that this routine often does not return since the thread that // is executing it will do an ACE_Thread::exit() first! +// The ACE_Task_Exit - ACE_Task_Base::svc_run () interaction works +// like this, with ACE_HAS_THREAD_SPECIFIC_STORAGE: +// o Every thread in an ACE task is run via +// ACE_Task_Base::svc_run (). +// o ACE_Task_Base::svc_run () retrieves the singleton +// ACE_Task_Exit instance from ACE_Task_Exit::instance (). +// The singleton gets created in thread specific storage +// in the first call to that function for an ACE_Task. +// The key point is that the instance is in thread specific +// storage. +// o The ACE_Task is destroyed, usually by the application +// following a call to Thread_Manager::wait (), which waits for +// all of the task's threads to finish. Alternatively, all of +// the threads can exit on their own. +// o If you follow this so far, now it gets really fun . . . +// When the thread specific storage (for the ACE_Task that +// is being destroyed) is cleaned up, the threads package is +// supposed to destroy any objects that are in thread specific +// storage. It has a list of 'em, and just walks down the +// list and destroys each one. +// o That's where the ACE_Task_Exit destructor gets called. + void * ACE_Task_Base::svc_run (void *args) { |