aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/include
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2006-06-21 20:56:37 +0000
committerKeith Seitz <kseitz@gcc.gnu.org>2006-06-21 20:56:37 +0000
commit7691d0d3c9d60eb732e71be4c7a100ef2bb2ef82 (patch)
tree55fd808e47f53739af4e710b68299196cc64643e /boehm-gc/include
parentc3238e32eb1c51e9cb8d75f5b3266bf3c831112f (diff)
downloadgcc-7691d0d3c9d60eb732e71be4c7a100ef2bb2ef82.zip
gcc-7691d0d3c9d60eb732e71be4c7a100ef2bb2ef82.tar.gz
gcc-7691d0d3c9d60eb732e71be4c7a100ef2bb2ef82.tar.bz2
pthread_stop_world.c (GC_suspend_handler): Redirect to suspension routine if signal is received and thread is flagged...
* pthread_stop_world.c (GC_suspend_handler): Redirect to suspension routine if signal is received and thread is flagged SUSPENDED. (suspend_self): New function. (GC_suspend_thread): New function. (GC_resume_thread): New function. * include/gc.h (GC_suspend_thread): Declare. (GC_resumet_thread): Declare. * include/private/pthread_support.h (SUSPENDED): New GC_thread flag. From-SVN: r114869
Diffstat (limited to 'boehm-gc/include')
-rw-r--r--boehm-gc/include/gc.h10
-rw-r--r--boehm-gc/include/private/pthread_support.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
index 3507db7..e6ab2c6 100644
--- a/boehm-gc/include/gc.h
+++ b/boehm-gc/include/gc.h
@@ -1040,4 +1040,14 @@ GC_API void GC_register_has_static_roots_callback
} /* end of extern "C" */
#endif
+/* External thread suspension support. These functions do not implement
+ * suspension counts or any other higher-level abstraction. Threads which
+ * have been suspended numerous times will resume with the very first call
+ * to GC_resume_thread.
+ */
+#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
+ && !defined(GC_WIN32_THREADS) && !defined(GC_DARWIN_THREADS)
+GC_API void GC_suspend_thread GC_PROTO((pthread_t));
+GC_API void GC_resume_thread GC_PROTO((pthread_t));
+#endif
#endif /* _GC_H */
diff --git a/boehm-gc/include/private/pthread_support.h b/boehm-gc/include/private/pthread_support.h
index 469021b..2186c07 100644
--- a/boehm-gc/include/private/pthread_support.h
+++ b/boehm-gc/include/private/pthread_support.h
@@ -33,6 +33,7 @@ typedef struct GC_Thread_Rep {
# define FINISHED 1 /* Thread has exited. */
# define DETACHED 2 /* Thread is intended to be detached. */
# define MAIN_THREAD 4 /* True for the original thread only. */
+# define SUSPENDED 8 /* True if thread was suspended externally */
short thread_blocked; /* Protected by GC lock. */
/* Treated as a boolean value. If set, */
/* thread will acquire GC lock before */