summaryrefslogtreecommitdiff
path: root/gnu/java/awt/peer/gtk/GtkMainThread.java
diff options
context:
space:
mode:
authorSteven Augart <augart@watson.ibm.com>2004-07-07 04:26:37 +0000
committerSteven Augart <augart@watson.ibm.com>2004-07-07 04:26:37 +0000
commit6f9fb9019f12ed9d9568b5e05476a1097ed14cae (patch)
tree711cd8351031ef0b5d7adda7c0d110eafe117976 /gnu/java/awt/peer/gtk/GtkMainThread.java
parented5ae0808a4393675deb8cb479470038d4b0d965 (diff)
downloadclasspath-6f9fb9019f12ed9d9568b5e05476a1097ed14cae.tar.gz
2004-07-07 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. * configure.ac: Correct description of PORTABLE_NATIVE_SYNC config.h definition. * native/jni/gtk-peer/gnu_java_awt_peer_gtk_GtkMainThread.c, include/gnu_java_awt_peer_gtk_GtkMainThread.h (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. * doc/vmintegration.texinfo (VM Threading Model): Explain the gnu.classpath.awt.gtk.portable.native.sync system property. * NEWS: Mention the gnu.classpath.awt.gtk.portable.native.sync new system property.
Diffstat (limited to 'gnu/java/awt/peer/gtk/GtkMainThread.java')
-rw-r--r--gnu/java/awt/peer/gtk/GtkMainThread.java25
1 files changed, 23 insertions, 2 deletions
diff --git a/gnu/java/awt/peer/gtk/GtkMainThread.java b/gnu/java/awt/peer/gtk/GtkMainThread.java
index 6efa84101..e591d2dfa 100644
--- a/gnu/java/awt/peer/gtk/GtkMainThread.java
+++ b/gnu/java/awt/peer/gtk/GtkMainThread.java
@@ -43,7 +43,15 @@ public class GtkMainThread extends GtkGenericPeer implements Runnable
private static Thread mainThread = null;
private static Object mainThreadLock = new Object();
- static native void gtkInit();
+ /**
+ * Call gtk_init. It is very important that this happen before any other
+ * gtk calls.
+ *
+ * @param portableNativeSync 1 if the Java property
+ * gnu.classpath.awt.gtk.portable.native.sync is set to "true". 0 if it is
+ * set to "false". -1 if unset.
+ */
+ static native void gtkInit(int portableNativeSync);
native void gtkMain();
public GtkMainThread()
@@ -67,9 +75,22 @@ public class GtkMainThread extends GtkGenericPeer implements Runnable
public void run()
{
+ /* Pass the value of the gnu.classpath.awt.gtk.portable.native.sync system
+ * property to C. */
+ int portableNativeSync;
+ String portNatSyncProp =
+ System.getProperty("gnu.classpath.awt.gtk.portable.native.sync");
+
+ if (portNatSyncProp == null)
+ portableNativeSync = -1; // unset
+ else if (Boolean.valueOf(portNatSyncProp).booleanValue())
+ portableNativeSync = 1; // true
+ else
+ portableNativeSync = 0; // false
+
synchronized (this)
{
- gtkInit();
+ gtkInit(portableNativeSync);
notify();
}
gtkMain();