[RFA/GC] redefine thread suspension interface for all platforms
Keith Seitz
keiths@redhat.com
Thu Jul 6 21:25:00 GMT 2006
Hi,
After last week's build debacle, I've decided to "do it right", or at
least what I think is right. I should know better than to resort to
conditionally including code.
Therefore, I would like to redefine the current suspension interface
from this mess:
#if defined(GC_PTHREADS) && !defined(GC_SOLARIS_THREADS) \
&& !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));
#endif
to the more readable/maintainable:
GC_API void GC_suspend_thread GC_PROTO((GC_thread_t));
GC_API void GC_resume_thread GC_PROTO((GC_thread_t));
Where GC_thread_t is defined appropriately for every platform. On
platforms where the functions are unimplemented (anything but posix
threads right now), the functions will call ABORT with an appropriate
message.
There are lots of different ways to do this, but I find this the least
offensive of the solutions I've pondered. There seems little sense in
submitting this to the GC list since no decision has been officially
made on the existence of GC_suspend/resume_thread yet.
I have tested this on x86 linux, powerpc-darwin, and x86 cygwin.
Nonetheless, the giant ifdef in gc.h will, I'm sure, not be complete (or
necessarily correct). I would appreciate it if those-in-the-know would
pay special attention to this.
Keith
ChangeLog
2006-07-06 Keith Seitz <keiths@redhat.com>
* include/gc.h (GC_thread_t): Define.
(GC_suspend_thread): Define for all platforms.
(GC_resume_thread): Likewise.
* darwin_stop_world.c (GC_suspend_thread): New function.
(GC_resume_thread): New function.
* pthread_stop_world.c (GC_suspend_thread): New function.
(GC_resume_thread): New function.
* solaris_threads.c (GC_suspend_thread): New function.
(GC_resume_thread): New function.
* win32_threads.c (GC_suspend_thread): New function.
(GC_resume_thread): New function.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gc.patch
Type: text/x-patch
Size: 3759 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20060706/9a66f4bb/attachment.bin>
More information about the Java-patches
mailing list