6953275: Many Swing tests are failing because of a GTK lib
authoranthony
Tue, 18 May 2010 19:35:41 +0400
changeset 5471 0b3ae448170e
parent 5445 952514d3c5fd
child 5472 faec19c0452c
6953275: Many Swing tests are failing because of a GTK lib Reviewed-by: art, dcherepanov
jdk/src/solaris/native/sun/awt/gtk2_interface.c
jdk/src/solaris/native/sun/awt/gtk2_interface.h
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Fri Apr 30 17:03:15 2010 -0700
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.c	Tue May 18 19:35:41 2010 +0400
@@ -77,6 +77,7 @@
 
 static void *gtk2_libhandle = NULL;
 static void *gthread_libhandle = NULL;
+static gboolean flag_g_thread_get_initialized = FALSE;
 static jmp_buf j;
 
 /* Widgets */
@@ -436,8 +437,10 @@
     fp_gtk_file_chooser_set_filter = dl_symbol("gtk_file_chooser_set_filter");
     fp_gtk_file_chooser_get_type = dl_symbol("gtk_file_chooser_get_type");
     fp_gtk_file_filter_new = dl_symbol("gtk_file_filter_new");
-    fp_gtk_file_chooser_set_do_overwrite_confirmation = dl_symbol(
-            "gtk_file_chooser_set_do_overwrite_confirmation");
+    if (fp_gtk_check_version(2, 8, 0) == NULL) {
+        fp_gtk_file_chooser_set_do_overwrite_confirmation = dl_symbol(
+                "gtk_file_chooser_set_do_overwrite_confirmation");
+    }
     fp_gtk_file_chooser_set_select_multiple = dl_symbol(
             "gtk_file_chooser_set_select_multiple");
     fp_gtk_file_chooser_get_current_folder = dl_symbol(
@@ -641,8 +644,6 @@
         /**
          * GLib thread system
          */
-        fp_g_thread_get_initialized = dl_symbol_gthread(
-                "g_thread_get_initialized");
         fp_g_thread_init = dl_symbol_gthread("g_thread_init");
         fp_gdk_threads_init = dl_symbol("gdk_threads_init");
         fp_gdk_threads_enter = dl_symbol("gdk_threads_enter");
@@ -744,7 +745,9 @@
 
     if (fp_gtk_check_version(2, 2, 0) == NULL) {
         // Init the thread system to use GLib in a thread-safe mode
-        if (!fp_g_thread_get_initialized()) {
+        if (!flag_g_thread_get_initialized) {
+            flag_g_thread_get_initialized = TRUE;
+
             fp_g_thread_init(NULL);
 
             //According the GTK documentation, gdk_threads_init() should be
--- a/jdk/src/solaris/native/sun/awt/gtk2_interface.h	Fri Apr 30 17:03:15 2010 -0700
+++ b/jdk/src/solaris/native/sun/awt/gtk2_interface.h	Tue May 18 19:35:41 2010 +0400
@@ -786,7 +786,6 @@
 guint (*fp_gtk_main_level)(void);
 
 
-gboolean (*fp_g_thread_get_initialized)(void);
 void (*fp_g_thread_init)(GThreadFunctions *vtable);
 void (*fp_gdk_threads_init)(void);
 void (*fp_gdk_threads_enter)(void);