diff --git a/src/solaris/classes/sun/awt/UNIXToolkit.java b/src/solaris/classes/sun/awt/UNIXToolkit.java index 047bbec1937a64083aeabf003f1f163f9263c3c7..d385dc1b7816b0b195f971c006f2b920bbc72777 100644 --- a/src/solaris/classes/sun/awt/UNIXToolkit.java +++ b/src/solaris/classes/sun/awt/UNIXToolkit.java @@ -31,7 +31,6 @@ import java.awt.image.*; import java.security.AccessController; import sun.security.action.GetIntegerAction; import com.sun.java.swing.plaf.gtk.GTKConstants.TextDirection; -import sun.awt.X11.XToolkit; import sun.java2d.opengl.OGLRenderQueue; public abstract class UNIXToolkit extends SunToolkit @@ -98,12 +97,7 @@ public abstract class UNIXToolkit extends SunToolkit public boolean loadGTK() { synchronized (GTK_LOCK) { if (nativeGTKLoaded == null) { - XToolkit.awtLock(); - try { - nativeGTKLoaded = load_gtk(); - } finally { - XToolkit.awtUnlock(); - } + nativeGTKLoaded = load_gtk(); } } return nativeGTKLoaded; diff --git a/src/solaris/native/sun/awt/gtk2_interface.c b/src/solaris/native/sun/awt/gtk2_interface.c index a9add84d3c3effaa1d40e38755b831fe923bec9e..1ba9beb625ad4d5de20aa2f00a41fb1fbc345476 100644 --- a/src/solaris/native/sun/awt/gtk2_interface.c +++ b/src/solaris/native/sun/awt/gtk2_interface.c @@ -33,6 +33,7 @@ #include "jvm_md.h" #include "sizecalc.h" #include +#include "awt.h" #define GTK2_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gtk-x11-2.0", "0") #define GTK2_LIB JNI_LIB_NAME("gtk-x11-2.0") @@ -890,6 +891,7 @@ gboolean gtk2_load(JNIEnv *env) * BadMatch errors which we would normally ignore. The IO error handler * is preserved here, too, just for consistency. */ + AWT_LOCK(); handler = XSetErrorHandler(NULL); io_handler = XSetIOErrorHandler(NULL); @@ -926,6 +928,7 @@ gboolean gtk2_load(JNIEnv *env) XSetErrorHandler(handler); XSetIOErrorHandler(io_handler); + AWT_UNLOCK(); /* Initialize widget array. */ for (i = 0; i < _GTK_WIDGET_TYPE_SIZE; i++)