aboutsummaryrefslogtreecommitdiff
path: root/boehm-gc/include
diff options
context:
space:
mode:
authorBryce McKinlay <mckinlay@redhat.com>2006-08-21 22:07:30 +0000
committerTom Tromey <tromey@gcc.gnu.org>2006-08-21 22:07:30 +0000
commit7ddf92a8742e02a5873daaafa0b660bf4a4c1a01 (patch)
tree4c9de9e1ba2a27a47f6d8da1bbd87446fe43e48f /boehm-gc/include
parentaccabadcf398fb27c0e13154b7d2d1d52fc4fdef (diff)
downloadgcc-7ddf92a8742e02a5873daaafa0b660bf4a4c1a01.zip
gcc-7ddf92a8742e02a5873daaafa0b660bf4a4c1a01.tar.gz
gcc-7ddf92a8742e02a5873daaafa0b660bf4a4c1a01.tar.bz2
re PR libgcj/13212 (JNI/CNI AttachCurrentThread does not register thread with garbage collector)
boehm-gc PR libgcj/13212: * configure.ac: Check for pthread_getattr_np(). Remove GC_PTHREAD_SYM_VERSION detection. * include/gc.h (GC_register_my_thread, GC_unregister_my_thread, GC_get_thread_stack_base): New declarations. * pthread_support.c (GC_register_my_thread, GC_unregister_my_thread, GC_get_thread_stack_base): New functions. (GC_delete_thread): Don't try to free the first_thread. * misc.c (GC_init_inner): Use GC_get_thread_stack_base() if possible. (pthread_create_, constr): Removed. (pthread_create): Don't rename. * include/gc_ext_config.h.in: Rebuilt. * include/gc_pthread_redirects.h (pthread_create): Define unconditionally. * include/gc_config.h.in: Rebuilt. * configure: Rebuilt. libjava * java/lang/natThread.cc (_Jv_AttachCurrentThread): Attach thread to GC. (_Jv_DetachCurrentThread): Detach thread from GC. * include/boehm-gc.h (_Jv_GCAttachThread, _Jv_GCDetachThread): Declare. * boehm.cc (_Jv_GCAttachThread): New function. (_Jv_GCDetachThread): Likewise. From-SVN: r116313
Diffstat (limited to 'boehm-gc/include')
-rw-r--r--boehm-gc/include/gc.h20
-rw-r--r--boehm-gc/include/gc_config.h.in6
-rw-r--r--boehm-gc/include/gc_ext_config.h.in2
-rw-r--r--boehm-gc/include/gc_pthread_redirects.h2
4 files changed, 23 insertions, 7 deletions
diff --git a/boehm-gc/include/gc.h b/boehm-gc/include/gc.h
index e6ab2c6..5ba1f4b 100644
--- a/boehm-gc/include/gc.h
+++ b/boehm-gc/include/gc.h
@@ -69,7 +69,6 @@
extern "C" {
# endif
-
/* Define word and signed_word to be unsigned and signed types of the */
/* size as char * or void *. There seems to be no way to do this */
/* even semi-portably. The following is probably no better/worse */
@@ -912,6 +911,25 @@ GC_API void (*GC_is_visible_print_proc)
# if defined(PCR) || defined(GC_SOLARIS_THREADS) || \
defined(GC_PTHREADS) || defined(GC_WIN32_THREADS)
/* Any flavor of threads except SRC_M3. */
+
+/* Register the current thread as a new thread whose stack(s) should */
+/* be traced by the GC. */
+/* If a platform does not implicitly do so, this must be called before */
+/* a thread can allocate garbage collected memory, or assign pointers */
+/* to the garbage collected heap. Once registered, a thread will be */
+/* stopped during garbage collections. */
+GC_API void GC_register_my_thread GC_PROTO((void));
+
+/* Register the current thread, with the indicated stack base, as */
+/* a new thread whose stack(s) should be traced by the GC. If a */
+/* platform does not implicitly do so, this must be called before a */
+/* thread can allocate garbage collected memory, or assign pointers */
+/* to the garbage collected heap. Once registered, a thread will be */
+/* stopped during garbage collections. */
+GC_API void GC_unregister_my_thread GC_PROTO((void));
+
+GC_API GC_PTR GC_get_thread_stack_base GC_PROTO((void));
+
/* This returns a list of objects, linked through their first */
/* word. Its use can greatly reduce lock contention problems, since */
/* the allocation lock can be acquired and released many fewer times. */
diff --git a/boehm-gc/include/gc_config.h.in b/boehm-gc/include/gc_config.h.in
index 401de60..5055b50 100644
--- a/boehm-gc/include/gc_config.h.in
+++ b/boehm-gc/include/gc_config.h.in
@@ -45,9 +45,6 @@
/* support for Tru64 pthreads */
#undef GC_OSF1_THREADS
-/* symbol version of pthread_create */
-#undef GC_PTHREAD_SYM_VERSION
-
/* support for Solaris pthreads */
#undef GC_SOLARIS_PTHREADS
@@ -81,6 +78,9 @@
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
+/* Define to 1 if you have the `pthread_getattr_np' function. */
+#undef HAVE_PTHREAD_GETATTR_NP
+
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
diff --git a/boehm-gc/include/gc_ext_config.h.in b/boehm-gc/include/gc_ext_config.h.in
index 716143d..219ba2f 100644
--- a/boehm-gc/include/gc_ext_config.h.in
+++ b/boehm-gc/include/gc_ext_config.h.in
@@ -4,4 +4,4 @@ is used by libjava/include/boehm-gc.h. */
#undef THREAD_LOCAL_ALLOC
-#undef GC_PTHREAD_SYM_VERSION
+#undef HAVE_PTHREAD_GETATTR_NP
diff --git a/boehm-gc/include/gc_pthread_redirects.h b/boehm-gc/include/gc_pthread_redirects.h
index f9d4939..842518c 100644
--- a/boehm-gc/include/gc_pthread_redirects.h
+++ b/boehm-gc/include/gc_pthread_redirects.h
@@ -68,9 +68,7 @@
# undef pthread_detach
#endif
-#ifndef GC_PTHREAD_SYM_VERSION
# define pthread_create GC_pthread_create
-#endif
# define pthread_join GC_pthread_join
# define pthread_detach GC_pthread_detach