portable-native-sync merged into libgcj gui branch
Mark Wielaard
mark@klomp.org
Tue Aug 3 16:44:00 GMT 2004
Hi,
This patch merges the new portable-native-sync patch that makes GTK+2
work on systems where the threading system of the (libgcj) runtime is
different from the default threading system of the glib threading
functions by providing helper functions that translate all glib
threading primitives into java-like primitives. I don't believe there
current is a platform that libgcj supports for which this is the case.
It was developed by Steven Augart for the IBM Jikes RVM (and for systems
like Kaffe jthreads) that don't natively do pthreads. It also introduces
some subtle fixes to gtk+ intialization in general.
To my surprise enabling this for libgcj does actually work. I had
trouble getting it working correctly with jikes RVM, jamvm and kaffe
(only jamvm partially worked). But with libgcj there seem to be no
problems. Which is a bit of bummer since I wanted to debug it using
libgcj/gdb :)
By default the support is turned off (like in GNU Classpath). But you
can enable it during runtime by setting a system property like:
gij -Dgnu.classpath.awt.gtk.portable.native.sync=true TestAWT
More documentation in the GNU Classpath section VM Threading Models:
http://www.gnu.org/software/classpath/docs/vmintegration.html#SEC7
2004-07-31 Mark Wielaard <mark@klomp.org>
* Makefile.am (gtk_c_source_files): Added
jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c.
(gtk_awt_peer_sources): Added
gnu/java/awt/peer/gtk/GThreadMutex.java and
gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java.
* Makefile.in: Regenerated.
2004-07-31 Archie Cobbs <archie@dellroad.org>
* jni/gtk-peer/gthread-jni.c: don't #include nonexistent files
2004-07-31 Steven Augart <augart@watson.ibm.com>
* jni/gtk-peer/gthread-jni.c (c-font-lock-extra-types):
Added jfieldID, jmethodID.
2004-07-31 Mark Wielaard <mark@klomp.org>
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit): Initialize
gdk_env before calling any gdk or gtk function.
* gnu/java/awt/peer/gtk/GtkMainThread.java (gtkInitCalled): New field.
(GtkMainThread): Call wait() in while loop waiting for gtkInitCalled.
(run): Set gtkInitCalled.
2004-07-31 Steven Augart <augart@watson.ibm.com>
* gnu/java/awt/peer/gtk/GtkMainThread.java (run): Pass the value of
the gnu.classpath.awt.gtk.portable.native.sync system property to C.
* jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(Java_gnu_java_awt_peer_gtk_GtkMainThread_gtkInit): New argument,
portableNativeSync. Delegate PORTABLE_NATIVE_SYNC work to
init_glib_threads.
(init_glib_threads): New function.
2004-07-31 Mark Wielaard <mark@klomp.org>
* jni/gtk-peer/gthread-jni.c: Define MIN_, MAX_ and NORM_
PRIORITY when not already defined in header file.
2004-07-31 Mark Wielaard <mark@klomp.org>
* jni/gtk-peer/gthread-jni.c (setup_cache): Call
ExceptionOccurred, not ExceptionCheck, when we don't have JNI 1.2.
2004-07-31 Steven Augart <augart@watson.ibm.com>
* gnu/native/jni/gtk-peer/gthread-jni.c: Indentation fixes.
Implemented missing functions for GTK2.
Added error handling.
Renamed static functions out of the g_ namespace.
Added TRACE_API_CALLS, EXPLAIN_TROUBLE, EXPLAIN_BROKEN,
EXPLAIN_BADLY_BROKEN, and DELETE_LOCAL_REFS options.
Rewrote global-reference code.
Eliminated cascading errors.
(mutex_trylock_jni_impl) Fully implemented.
(cond_timed_wait_jni_impl) Went from millisecond to microsecond
resolution.
(setup_cache) New function.
(mutex_cond_wait_jni_impl, mutex_cond_timed_wait_jni_impl) Fixed
bug where they were not unlocking the GMutex associated with the
condition variable during the wait on that condition variable.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c,
native/jni/gtk-peer/gthread-jni.c,
native/jni/gtk-peer/gthread-jni.h
(g_thread_jni_functions): Renamed to ...
(portable_native_sync_jni_functions): this name.
(gdk_vm): Renamed to...
(the_vm): this name.
* native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c
(gdk_vm): Removed duplicate definition.
(gtkInit): Removed stray message to stdout.
(gtkInit): Use g_malloc and g_free instead of malloc and free.
(gtkInit): Fix a const assignment bug.
(gtkInit): Simplified code.
* gnu/java/awt/peer/gtk/GThreadNativeMethodRunner.java,
native/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.c,
native/jni/gtk-peer/gnu_java_awt_peer_gtk_GThreadNativeMethodRunner.h,
gnu/java/awt/peer/gtk/GThreadMutex.java:
New files.
Commited to the gui-branch.
Cheers,
Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch12
Type: text/x-patch
Size: 121208 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040803/29770067/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://gcc.gnu.org/pipermail/java-patches/attachments/20040803/29770067/attachment.sig>
More information about the Java-patches
mailing list