* include/gc.h: (GCEventType): Added start-stop the world events.
authorMassimiliano Mantione <massi@mono-cvs.ximian.com>
Thu, 7 Feb 2008 09:51:20 +0000 (09:51 -0000)
committerMassimiliano Mantione <massi@mono-cvs.ximian.com>
Thu, 7 Feb 2008 09:51:20 +0000 (09:51 -0000)
* pthread_stop_world.c: (GC_stop_world and GC_start_world): hooked

svn path=/trunk/mono/; revision=95125

libgc/ChangeLog
libgc/include/gc.h
libgc/pthread_stop_world.c

index 3221d7729c36d4ae40391d4f5b081c0071d4c375..3bfe49b6e73651342aac60a5904f3db1e1133ae5 100644 (file)
@@ -1,3 +1,8 @@
+2008-02-07  Massimiliano Mantione  <massi@ximian.com>
+       * include/gc.h: (GCEventType): Added start-stop the world events.
+       * pthread_stop_world.c: (GC_stop_world and GC_start_world): hooked
+       start-stop the world events.
+
 2007-11-05  Geoff Norton  <gnorton@novell.com>
 
        * darwin_stop_world.c: Correct the structure name on Darwin-x86 for Leopard.
index ba73ea09a556dbd1305564c521ee0bfddd049cc9..375cc18a554c3a328e1eb988ec269ef21aba1f5a 100644 (file)
@@ -98,7 +98,11 @@ typedef enum {
        GC_EVENT_MARK_END,
        GC_EVENT_RECLAIM_START,
        GC_EVENT_RECLAIM_END,
-       GC_EVENT_END
+       GC_EVENT_END,
+       GC_EVENT_PRE_STOP_WORLD,
+       GC_EVENT_POST_STOP_WORLD,
+       GC_EVENT_PRE_START_WORLD,
+       GC_EVENT_POST_START_WORLD
 } GCEventType;
 
 GC_API void (*GC_notify_event) GC_PROTO((GCEventType event_type));
index 1ed16132897ef4498bc890a2544c3912c58a7c92..04eb3712c263d9831af128e93c174c61e813635c 100644 (file)
@@ -414,6 +414,8 @@ static void pthread_stop_world()
 /* Caller holds allocation lock.       */
 void GC_stop_world()
 {
+    if (GC_notify_event)
+        GC_notify_event (GC_EVENT_PRE_STOP_WORLD);
     /* Make sure all free list construction has stopped before we start. */
     /* No new construction can start, since free list construction is  */
     /* required to acquire and release the GC lock before it starts,   */
@@ -433,6 +435,8 @@ void GC_stop_world()
 #   ifdef PARALLEL_MARK
       GC_release_mark_lock();
 #   endif
+    if (GC_notify_event)
+        GC_notify_event (GC_EVENT_POST_STOP_WORLD);
 }
 
 /* Caller holds allocation lock, and has held it continuously since    */
@@ -449,6 +453,8 @@ static void pthread_start_world()
 #   if DEBUG_THREADS
       GC_printf0("World starting\n");
 #   endif
+    if (GC_notify_event)
+        GC_notify_event (GC_EVENT_PRE_START_WORLD);
 
     for (i = 0; i < THREAD_TABLE_SZ; i++) {
       for (p = GC_threads[i]; p != 0; p = p -> next) {
@@ -488,6 +494,8 @@ static void pthread_start_world()
        }
     }
   
+    if (GC_notify_event)
+        GC_notify_event (GC_EVENT_POST_START_WORLD);
     #if DEBUG_THREADS
       GC_printf0("World started\n");
     #endif