(Cherry-picked commit
30c2f0e from 'gcc_boehmgc' branch.)
* include/gc.h (GC_is_thread_suspended): Declare.
* pthread_stop_world.c (GC_is_thread_suspended): New function.
Conflicts:
* ChangeLog
* include/gc.h
* pthread_stop_world.c
&& !defined(GC_WIN32_THREADS) && !defined(GC_DARWIN_THREADS)
GC_API void GC_suspend_thread(pthread_t);
GC_API void GC_resume_thread(pthread_t);
+GC_API int GC_is_thread_suspended(pthread_t);
#endif
#ifdef __cplusplus
t -> flags &= ~SUSPENDED_EXT;
}
+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_EXT);
+}
+
#endif /* !GC_OPENBSD_UTHREADS && !NACL */
#ifdef IA64