aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/pthread_stop_world.c
diff options
context:
space:
mode:
authorKeith Seitz <keiths@redhat.com>2007-04-23 21:10:09 +0000
committerKeith Seitz <kseitz@gcc.gnu.org>2007-04-23 21:10:09 +0000
commit494d64aff614f95d4aa0d34b7d7d7190cdd4ab91 (patch)
treea822c7088bc6655548461fbcca4c0a74b1e7d525 /boehm-gc/pthread_stop_world.c
parentf749a55bb4aa154a19b4a029ddf85b7393f52262 (diff)
downloadgcc-494d64aff614f95d4aa0d34b7d7d7190cdd4ab91.zip
gcc-494d64aff614f95d4aa0d34b7d7d7190cdd4ab91.tar.gz
gcc-494d64aff614f95d4aa0d34b7d7d7190cdd4ab91.tar.bz2
gc.h (GC_is_thread_suspended): Declare.
* include/gc.h (GC_is_thread_suspended): Declare. * pthread_stop_world.c (GC_is_thread_suspended): New function. From-SVN: r124081
Diffstat (limited to 'boehm-gc/pthread_stop_world.c')
-rw-r--r--boehm-gc/pthread_stop_world.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/boehm-gc/pthread_stop_world.c b/boehm-gc/pthread_stop_world.c
index 211e6b8..bc3c901 100644
--- a/boehm-gc/pthread_stop_world.c
+++ b/boehm-gc/pthread_stop_world.c
@@ -483,6 +483,14 @@ void GC_resume_thread(pthread_t thread) {
t -> flags &= ~SUSPENDED;
}
+int GC_is_thread_suspended(pthread_t thread) {
+ GC_thread t = GC_lookup_thread(thread);
+ if (t == NULL)
+ ABORT("querying suspension state of unknown thread");
+
+ return (t -> flags & SUSPENDED);
+}
+
/* Caller holds allocation lock, and has held it continuously since */
/* the world stopped. */
void GC_start_world()