Fixed a bug in threads that occured when switching from a thread
authorschani <none@none>
Wed, 28 May 2003 11:31:50 +0000 (11:31 +0000)
committerschani <none@none>
Wed, 28 May 2003 11:31:50 +0000 (11:31 +0000)
that has just been killed to a thread that is being run for the
first time.

src/threads/green/threads.c
threads/thread.c

index d9565d8649c9f0000dcff6bddffac9595987db76..4ebb09791a24c2a93fbba6d9f477648c8be35a64 100644 (file)
@@ -330,6 +330,14 @@ firstStartThread(void)
 
     DBG( printf("firstStartThread %p\n", currentThread); );
 
+       if (stack_to_be_freed != 0)
+       {
+#ifndef USE_BOEHM
+               free(stack_to_be_freed);
+#endif
+               stack_to_be_freed = 0;
+       }
+
        /* Every thread starts with the interrupts off */
        intsRestore();
        assert(blockInts == 0);
index d9565d8649c9f0000dcff6bddffac9595987db76..4ebb09791a24c2a93fbba6d9f477648c8be35a64 100644 (file)
@@ -330,6 +330,14 @@ firstStartThread(void)
 
     DBG( printf("firstStartThread %p\n", currentThread); );
 
+       if (stack_to_be_freed != 0)
+       {
+#ifndef USE_BOEHM
+               free(stack_to_be_freed);
+#endif
+               stack_to_be_freed = 0;
+       }
+
        /* Every thread starts with the interrupts off */
        intsRestore();
        assert(blockInts == 0);