Author: leo
Date: Wed Apr 27 01:24:17 2005
New Revision: 7931

Modified:
   trunk/classes/parrotthread.pmc
   trunk/src/dod.c
   trunk/src/pic.c
Log:
disable DOD, GC in threads

Modified: trunk/classes/parrotthread.pmc
==============================================================================
--- trunk/classes/parrotthread.pmc      (original)
+++ trunk/classes/parrotthread.pmc      Wed Apr 27 01:24:17 2005
@@ -40,6 +40,20 @@
 #include "parrot/embed.h"
 #include <assert.h>
 
+/*
+ * can't do multi-threaded DOD/GC yet
+ * XXX a quick hack to pass the few tests
+ */
+static void
+stop_GC(Interp* parent, Interp *thread)
+{
+    Parrot_block_DOD(parent);
+    Parrot_block_DOD(thread);
+    Parrot_block_GC(parent);
+    Parrot_block_GC(thread);
+}
+
+
 pmclass ParrotThread extends ParrotInterpreter need_ext {
 
 /*
@@ -60,6 +74,10 @@
         SUPER();
         pt_add_to_interpreters(INTERP, PMC_data(SELF));
         UNLOCK(interpreter_array_mutex);
+        /*
+         * can't allow DOD runs for now
+         */
+        stop_GC(INTERP, PMC_data(SELF));
     }
 
 /*
@@ -77,6 +95,10 @@
         SUPER(parent);
         pt_add_to_interpreters(PMC_data(parent), PMC_data(SELF));
         UNLOCK(interpreter_array_mutex);
+        /*
+         * can't allow DOD runs for now
+         */
+        stop_GC(INTERP, PMC_data(SELF));
     }
 }
 

Modified: trunk/src/dod.c
==============================================================================
--- trunk/src/dod.c     (original)
+++ trunk/src/dod.c     Wed Apr 27 01:24:17 2005
@@ -807,29 +807,37 @@
 #endif
                 /* if object is a PMC and needs destroying */
                 if (PObj_is_PMC_TEST(b)) {
+                    PMC *p = (PMC*)b;
+                    /*
+                     * XXX
+                     * for now don't mess around with shared objects
+                     */
+                    if (p->vtable->flags & VTABLE_IS_SHARED_FLAG)
+                        goto next;
+
                     /* then destroy it here
                     */
-                    if (PObj_needs_early_DOD_TEST(b))
+                    if (PObj_needs_early_DOD_TEST(p))
                         --arena_base->num_early_DOD_PMCs;
-                    if (PObj_active_destroy_TEST(b))
-                        VTABLE_destroy(interpreter, (PMC *)b);
+                    if (PObj_active_destroy_TEST(p))
+                        VTABLE_destroy(interpreter, p);
 
-                    if (PObj_is_PMC_EXT_TEST(b)) {
+                    if (PObj_is_PMC_EXT_TEST(p)) {
                         /* if the PMC has a PMC_EXT structure,
                          * return it to the pool/arena
                          */
                         struct Small_Object_Pool *ext_pool =
                             arena_base->pmc_ext_pool;
                         ext_pool->add_free_object(interpreter, ext_pool,
-                                ((PMC *)b)->pmc_ext);
+                                p->pmc_ext);
                     }
 #ifndef NDEBUG
                     /*
                      * invalidate the PMC
                      */
-                    PMC_struct_val((PMC*)b) = (void*)0xdeadbeef;
-                    PMC_pmc_val((PMC*)b) = (void*)0xdeadbeef;
-                    ((PMC*)b)->pmc_ext = (void*)0xdeadbeef;
+                    PMC_struct_val(p) = (void*)0xdeadbeef;
+                    PMC_pmc_val(p) = (void*)0xdeadbeef;
+                    p->pmc_ext = (void*)0xdeadbeef;
 #endif
                 }
                 /* else object is a buffer(like) */
@@ -884,6 +892,7 @@
 #endif
                 pool->add_free_object(interpreter, pool, b);
             }
+next:
             b = (Buffer *)((char *)b + object_size);
         }
 #if ARENA_DOD_FLAGS

Modified: trunk/src/pic.c
==============================================================================
--- trunk/src/pic.c     (original)
+++ trunk/src/pic.c     Wed Apr 27 01:24:17 2005
@@ -69,6 +69,7 @@
                  * an INTVAL holding the type
                  *
                  * TODO if beyond limit use a malloced array
+                 *      or just C<break> instead w/o rewriting the op
                  */
                 pmc_type_numbers[type] = type;
                 pc_pred[2] = pmc_type_numbers + type;

Reply via email to