summaryrefslogtreecommitdiffstats
path: root/boehm-gc/quick_threads.c
diff options
context:
space:
mode:
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-07 08:01:42 +0000
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>1999-04-07 08:01:42 +0000
commit22b297cdeaa7704bc964a76562dcf8aed710c2bb (patch)
tree7f963ae6b27df44232d80c837e9ccc32932e94af /boehm-gc/quick_threads.c
parent386fe957b821b33f2ff2724bf5aaf0c6030c6a99 (diff)
downloadppe42-gcc-22b297cdeaa7704bc964a76562dcf8aed710c2bb.tar.gz
ppe42-gcc-22b297cdeaa7704bc964a76562dcf8aed710c2bb.zip
Cygnus/libgcj changes to Boehm GC.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@26257 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'boehm-gc/quick_threads.c')
-rw-r--r--boehm-gc/quick_threads.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/boehm-gc/quick_threads.c b/boehm-gc/quick_threads.c
new file mode 100644
index 00000000000..adc26da6d59
--- /dev/null
+++ b/boehm-gc/quick_threads.c
@@ -0,0 +1,55 @@
+/*
+ * Support code for cooperative coop/quick threads.
+ * Copyright (c) 1998, 1999 Cygnus Solutions.
+ */
+
+#include "boehm-config.h"
+
+#ifdef QUICK_THREADS
+
+#include "gc_priv.h"
+
+#include "coop.h"
+
+void GC_push_all_stacks (void)
+{
+ coop_t *t;
+ ptr_t lo, hi;
+
+ t = coop_first_thread ();
+
+ if (t == NULL)
+ {
+ /* Threads haven't started, so mark the real stack. */
+#ifdef STACK_GROWS_DOWN
+ GC_push_all_stack( GC_approx_sp(), GC_stackbottom );
+#else
+ GC_push_all_stack( GC_stackbottom, GC_approx_sp() );
+#endif
+ }
+ else
+ {
+ for ( ; t != NULL; t = coop_next_thread (t))
+ {
+ if (t == coop_global_curr)
+ lo = GC_approx_sp ();
+ else
+ {
+ lo = t->top;
+ /* LO can be NULL when the new thread has not yet been
+ used. */
+ if (! lo)
+ continue;
+ }
+ hi = t->base;
+
+#ifdef STACK_GROWS_DOWN
+ GC_push_all_stack (lo, hi);
+#else
+ GC_push_all_stack (hi, lo);
+#endif
+ }
+ }
+}
+
+#endif /* QUICK_THREADS */
OpenPOWER on IntegriCloud