Skip to content

Commit

Permalink
* include/gc.h (GC_is_thread_suspended): Declare.
Browse files Browse the repository at this point in the history
        * 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
  • Loading branch information
kseitz committed Apr 23, 2007
1 parent 4712681 commit d58a52c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
5 changes: 5 additions & 0 deletions boehm-gc/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2007-04-23 Keith Seitz <[email protected]>

* include/gc.h (GC_is_thread_suspended): Declare.
* pthread_stop_world.c (GC_is_thread_suspended): New function.

2007-04-03 Jakub Jelinek <[email protected]>

* configure.ac (NO_EXECUTE_PERMISSION): Set by default.
Expand Down
1 change: 1 addition & 0 deletions boehm-gc/include/gc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
8 changes: 8 additions & 0 deletions boehm-gc/pthread_stop_world.c
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit d58a52c

Please sign in to comment.