summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-05-13 00:35:45 +0000
committernanbor <nanbor@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-05-13 00:35:45 +0000
commitf70f9fc4e675ab97bfaae81e7a92cb68993a2a79 (patch)
tree76bd07a02c7fb37b50042381d4ceabf215f226b8
parent57c5351b0a2863f3ae6eeb886d73013643b3a179 (diff)
downloadATCD-f70f9fc4e675ab97bfaae81e7a92cb68993a2a79.tar.gz
ChangeLogTag:Mon May 12 19:27:54 2003 Nanbor Wang <nanbor@cs.wustl.edu>
-rw-r--r--ChangeLog14
-rw-r--r--ace/Thread_Manager.cpp36
2 files changed, 32 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 1dc7c705afc..d67d28bdae6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+Mon May 12 19:27:54 2003 Nanbor Wang <nanbor@cs.wustl.edu>
+
+ * ace/Thread_Manager.cpp (wait): Fixed an occasional assertion
+ failure during shutdown of our servers which seems be caused by
+ a double deletion of an item in the ACE_Thread_Manager
+ terminated_thr_list_ in ACE_Thread_Manager::wait ().
+
+ The statement "item = this->terminated_thr_list_.delete_head ()"
+ is not protected by the mutex and can be access by
+ more than one thread modifying the terminated_thr_list_.
+ Extending the mutex protection scope fixed this problem.
+ Thanks to Bruce McIntosh <bruce.mcintosh@boeing.com> for
+ suggesting the fix. [Bug 1505]
+
Mon May 12 13:32:56 2003 Chad Elliott <elliott_c@ociweb.com>
* bin/MakeProjectCreator/modules/ProjectCreator.pm:
diff --git a/ace/Thread_Manager.cpp b/ace/Thread_Manager.cpp
index 836fbe827ef..252ca9fb7b3 100644
--- a/ace/Thread_Manager.cpp
+++ b/ace/Thread_Manager.cpp
@@ -1755,37 +1755,37 @@ ACE_Thread_Manager::wait (const ACE_Time_Value *timeout,
// Program is shutting down, no chance to wait on threads.
// Therefore, we'll just remove threads from the list.
this->remove_thr_all ();
- // Release the guard, giving other threads a chance to run.
- }
#if !defined (VXWORKS)
- // @@ VxWorks doesn't support thr_join (yet.) We are working
- //on our implementation. Chorus'es thr_join seems broken.
- ACE_Thread_Descriptor_Base *item;
+ // @@ VxWorks doesn't support thr_join (yet.) We are working
+ //on our implementation. Chorus'es thr_join seems broken.
+ ACE_Thread_Descriptor_Base *item;
#if defined (CHORUS)
- if (ACE_Object_Manager::shutting_down () != 1)
- {
+ if (ACE_Object_Manager::shutting_down () != 1)
+ {
#endif /* CHORUS */
- while ((item = this->terminated_thr_list_.delete_head ()) != 0)
- {
- if (ACE_BIT_DISABLED (item->flags_, THR_DETACHED | THR_DAEMON)
- || ACE_BIT_ENABLED (item->flags_, THR_JOINABLE))
- // Detached handles shouldn't reached here.
+ while ((item = this->terminated_thr_list_.delete_head ()) != 0)
+ {
+ if (ACE_BIT_DISABLED (item->flags_, THR_DETACHED | THR_DAEMON)
+ || ACE_BIT_ENABLED (item->flags_, THR_JOINABLE))
+ // Detached handles shouldn't reached here.
ACE_Thread::join (item->thr_handle_);
# if defined (ACE_HAS_PTHREADS_DRAFT4) && defined (ACE_LACKS_SETDETACH)
- // Must explicitly detach threads. Threads without
- // THR_DETACHED were detached in ACE_OS::thr_create ().
- ::pthread_detach (&item->thr_handle_);
+ // Must explicitly detach threads. Threads without
+ // THR_DETACHED were detached in ACE_OS::thr_create ().
+ ::pthread_detach (&item->thr_handle_);
# endif /* ACE_HAS_PTHREADS_DRAFT4 && ACE_LACKS_SETDETACH */
- delete item;
- }
+ delete item;
+ }
#if defined (CHORUS)
- }
+ }
#endif /* CHORUS */
#endif /* ! VXWORKS */
+ // Release the guard, giving other threads a chance to run.
+ }
#else
ACE_UNUSED_ARG (timeout);
ACE_UNUSED_ARG (abandon_detached_threads);