]> granicus.if.org Git - gc/commitdiff
* include/gc.h (GC_is_thread_suspended): Declare.
authorkseitz <kseitz@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 23 Apr 2007 21:10:09 +0000 (21:10 +0000)
committerguest <ivmai@mail.ru>
Fri, 29 Jul 2011 06:54:28 +0000 (10:54 +0400)
        * pthread_stop_world.c (GC_is_thread_suspended): New function.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@124081 138bc75d-0d04-0410-961f-82ee72b054a4

ChangeLog
include/gc.h
pthread_stop_world.c

index aad88393f8ade447cb9ead020dd631d1b242ebb0..69f1685ad9215439e4809b371d73e3d41e964fb0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-04-23  Keith Seitz  <keiths@redhat.com>
+
+       * include/gc.h (GC_is_thread_suspended): Declare.
+       * pthread_stop_world.c (GC_is_thread_suspended): New function.
+
 2007-04-03  Jakub Jelinek  <jakub@redhat.com>
 
        * configure.ac (NO_EXECUTE_PERMISSION): Set by default.
index c6c553d8427516640ca6126fab2977146b946e8c..c51e017d67483e05bf5b7a790e03dd90cd1f8efb 100644 (file)
@@ -1085,5 +1085,6 @@ GC_API void GC_register_has_static_roots_callback
   && !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));
+GC_API int GC_is_thread_suspended GC_PROTO((pthread_t));
 #endif
 #endif /* _GC_H */
index 211e6b89e06ff476c58ecbd1b61d2fe0a3453a27..bc3c901dccfd39919f11bffa3bd9337912903a95 100644 (file)
@@ -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()