Skip to content

Commit 5ea2b64

Browse files
author
Alexander Zvegintsev
committed
8372977: unnecessary gthread-2.0 loading
Reviewed-by: prr, kizune
1 parent e534ee9 commit 5ea2b64

File tree

2 files changed

+0
-27
lines changed

2 files changed

+0
-27
lines changed

src/java.desktop/unix/native/libawt_xawt/awt/gtk3_interface.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
#include "debug_assert.h"
4343

4444
static void *gtk3_libhandle = NULL;
45-
static void *gthread_libhandle = NULL;
4645

4746
static void transform_detail_string (const gchar *detail,
4847
GtkStyleContext *context);
@@ -79,15 +78,6 @@ static void* dl_symbol(const char* name)
7978
return result;
8079
}
8180

82-
static void* dl_symbol_gthread(const char* name)
83-
{
84-
void* result = dlsym(gthread_libhandle, name);
85-
if (!result)
86-
longjmp(j, NO_SYMBOL_EXCEPTION);
87-
88-
return result;
89-
}
90-
9181
gboolean gtk3_check(const char* lib_name, gboolean load)
9282
{
9383
if (gtk3_libhandle != NULL) {
@@ -264,13 +254,6 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
264254
return FALSE;
265255
}
266256

267-
gthread_libhandle = dlopen(GTHREAD_LIB_VERSIONED, RTLD_LAZY | RTLD_LOCAL);
268-
if (gthread_libhandle == NULL) {
269-
gthread_libhandle = dlopen(GTHREAD_LIB, RTLD_LAZY | RTLD_LOCAL);
270-
if (gthread_libhandle == NULL)
271-
return FALSE;
272-
}
273-
274257
if (setjmp(j) == 0)
275258
{
276259
fp_gtk_check_version = dl_symbol("gtk_check_version");
@@ -634,9 +617,6 @@ GtkApi* gtk3_load(JNIEnv *env, const char* lib_name)
634617
dlclose(gtk3_libhandle);
635618
gtk3_libhandle = NULL;
636619

637-
dlclose(gthread_libhandle);
638-
gthread_libhandle = NULL;
639-
640620
return NULL;
641621
}
642622

@@ -735,7 +715,6 @@ static int gtk3_unload()
735715

736716
dlerror();
737717
dlclose(gtk3_libhandle);
738-
dlclose(gthread_libhandle);
739718
if ((gtk3_error = dlerror()) != NULL)
740719
{
741720
return FALSE;

src/java.desktop/unix/native/libawt_xawt/awt/gtk_interface.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,6 @@
3838
#define TRUE (!FALSE)
3939
#endif
4040

41-
#define GTHREAD_LIB_VERSIONED VERSIONED_JNI_LIB_NAME("gthread-2.0", "0")
42-
#define GTHREAD_LIB JNI_LIB_NAME("gthread-2.0")
43-
4441
#define _G_TYPE_CIC(ip, gt, ct) ((ct*) ip)
4542
#define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) \
4643
(_G_TYPE_CIC ((instance), (g_type), c_type))
@@ -850,9 +847,6 @@ typedef struct GtkApi {
850847
gboolean gtk_load(JNIEnv *env, GtkVersion version, gboolean verbose);
851848
gboolean gtk_check_version(GtkVersion version);
852849

853-
typedef struct _GThreadFunctions GThreadFunctions;
854-
static gboolean (*fp_g_thread_get_initialized)(void);
855-
static void (*fp_g_thread_init)(GThreadFunctions *vtable);
856850
static void (*fp_gdk_threads_init)(void);
857851
static void (*fp_gdk_threads_enter)(void);
858852
static void (*fp_gdk_threads_leave)(void);

0 commit comments

Comments
 (0)