[PATCH] score: Hold the object allocator lock in rtems_iterate_over_all_threads.

Chris Johns chrisj at rtems.org
Fri Jul 22 01:52:30 UTC 2016


---
 cpukit/score/src/iterateoverthreads.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/cpukit/score/src/iterateoverthreads.c b/cpukit/score/src/iterateoverthreads.c
index 8933352..3296914 100644
--- a/cpukit/score/src/iterateoverthreads.c
+++ b/cpukit/score/src/iterateoverthreads.c
@@ -31,6 +31,8 @@ void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
   if ( !routine )
     return;
 
+  _Objects_Allocator_lock( );
+
   for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
     #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG)
       if ( !_Objects_Information_table[ api_index ] )
@@ -51,4 +53,5 @@ void rtems_iterate_over_all_threads(rtems_per_thread_routine routine)
     }
   }
 
+  _Objects_Allocator_unlock( );
 }
-- 
2.4.6



More information about the devel mailing list