about summary refs log tree commit diff stats
path: root/xombrero.c
diff options
context:
space:
mode:
Diffstat (limited to 'xombrero.c')
-rw-r--r--xombrero.c148
1 files changed, 3 insertions, 145 deletions
diff --git a/xombrero.c b/xombrero.c
index 5800d23..b714ad4 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -48,10 +48,6 @@ uint32_t		swm_debug = 0
 			    ;
 #endif
 
-#ifdef USE_THREADS
-GCRY_THREAD_OPTION_PTHREAD_IMPL;
-#endif
-
 char		*icons[] = {
 	"xombreroicon16.png",
 	"xombreroicon32.png",
@@ -1109,21 +1105,6 @@ run_script(struct tab *t, char *s)
 	return (0);
 }
 
-int
-run_script_locked(struct tab *t, char *s)
-{
-	int		rv;
-#ifdef USE_THREADS
-	gdk_threads_enter();
-#endif
-	rv = run_script(t, s);
-#ifdef USE_THREADS
-	GDK_FLUSH();
-	gdk_threads_leave();
-#endif
-	return (rv);
-}
-
 void
 enable_hints(struct tab *t)
 {
@@ -1883,23 +1864,6 @@ done:
 	return (0);
 }
 
-/*
- * args must be allocated dynamically as the thread that added this function
- * to the idle loop no longer exists
- */
-gboolean
-warn_cert_cache_differs_idle(struct karg *args)
-{
-	if (args == NULL) {
-		show_oops(NULL, "%s: invalid parameters", __func__);
-		/* return 0 to not re-add function to the idle loop */
-		return (0);
-	}
-	xtp_page_sv((struct tab *)args->ptr, args);
-	g_free(args);
-	return (0);
-}
-
 /* Checks whether the remote cert is identical to the local saved
  * cert.  Returns CERT_LOCAL if unchanged, CERT_UNTRUSTED if local
  * cert does not exist, and CERT_BAD if different. 
@@ -1965,7 +1929,6 @@ check_cert_changes(struct tab *t, GTlsCertificate *cert, const char *file, const
 	SoupURI			*soupuri = NULL;
 	struct karg		args = {0};
 	struct wl_entry		*w = NULL;
-	struct karg		*argsp;
 	char			*chain = NULL;
 	int			ret = 0;
 
@@ -1988,10 +1951,8 @@ check_cert_changes(struct tab *t, GTlsCertificate *cert, const char *file, const
 		if ((w = wl_find(soupuri->host, &svil)) != NULL)
 			break;
 		t->xtp_meaning = XT_XTP_TAB_MEANING_SV;
-		argsp = g_malloc0(sizeof(struct karg));
-		argsp->s = g_strdup((char *)uri);
-		argsp->ptr = (void *)t;
-		g_idle_add((GSourceFunc)warn_cert_cache_differs_idle, argsp);
+		args.s = g_strdup((char *)uri);
+		xtp_page_sv(t, &args);
 		break;
 	}
 
@@ -4057,10 +4018,6 @@ notify_load_status_cb(WebKitWebView* wview, GParamSpec* pspec, struct tab *t)
 		t->focus_wv = 1;
 
 		marks_clear(t);
-#ifdef USE_THREAD
-		/* kill color thread */
-		t->thread = NULL;
-#endif
 		break;
 
 	case WEBKIT_LOAD_COMMITTED:
@@ -4322,7 +4279,7 @@ nofile:
 	}
 
 	DNPRINTF(XT_D_JS, "%s: about to run script\n", __func__);
-	run_script_locked(t, js);
+	run_script(t, js);
 
 done:
 	if (su)
@@ -7187,10 +7144,6 @@ delete_tab(struct tab *t)
 	if (t == NULL)
 		return;
 
-	/*
-	 * no need to join thread here because it won't access t on completion
-	 */
-
 	TAILQ_REMOVE(&tabs, t, entry);
 	buffercmd_abort(t);
 
@@ -8221,81 +8174,6 @@ usage(void)
 	exit(0);
 }
 
-GStaticRecMutex		my_gdk_mtx = G_STATIC_REC_MUTEX_INIT;
-volatile int		mtx_depth;
-int			mtx_complain;
-
-/*
- * The linux flash plugin violates the gdk locking mechanism.
- * Work around the issue by using a recursive mutex with some match applied
- * to see if we hit a buggy condition.
- *
- * The following code is painful so just don't read it.  It really doesn't
- * make much sense but seems to work.
- */
-void
-mtx_lock(void)
-{
-#ifdef XT_DEBUG
-	char		*s = NULL;
-#endif
-
-	g_static_rec_mutex_lock(&my_gdk_mtx);
-	if (my_gdk_mtx.depth <= 0) {
-#ifdef XT_DEBUG
-		s = "lock <= 0";
-#endif
-		g_static_rec_mutex_lock(&my_gdk_mtx);
-		goto complain;
-	} else if (my_gdk_mtx.depth != 1) {
-#ifdef XT_DEBUG
-		s = "lock != 1";
-#endif
-		do {
-			g_static_rec_mutex_unlock(&my_gdk_mtx);
-		} while (my_gdk_mtx.depth > 1);
-		goto complain;
-	}
-	return;
-
-complain:
-	if (mtx_complain == 0) {
-		DNPRINTF(XT_D_MTX, "buggy mutex implementation detected(%s), "
-		    "work around implemented", s);
-		mtx_complain = 1;
-	}
-}
-
-void
-mtx_unlock(void)
-{
-#ifdef XT_DEBUG
-	char		*s = NULL;
-#endif
-
-	if (my_gdk_mtx.depth <= 0) {
-#ifdef XT_DEBUG
-		s = "unlock <= 0";
-#endif
-		goto complain;
-	} else if (my_gdk_mtx.depth != 1) {
-#ifdef XT_DEBUG
-		s = "unlock != 1";
-#endif
-		g_static_rec_mutex_unlock_full(&my_gdk_mtx);
-		goto complain;
-	}
-	g_static_rec_mutex_unlock(&my_gdk_mtx);
-	return;
-
-complain:
-	if (mtx_complain == 0) {
-		DNPRINTF(XT_D_MTX, "buggy mutex implementation detected(%s), "
-		    "work around implemented", s);
-		mtx_complain = 1;
-	}
-}
-
 #if GTK_CHECK_VERSION(3, 0, 0)
 void
 setup_css(void)
@@ -8360,20 +8238,6 @@ main(int argc, char **argv)
 		os_init();
 
 	/* prepare gtk */
-#ifdef USE_THREADS
-#if !defined __MINGW32__
-	/* http://web.archiveorange.com/archive/v/UsPjxkX5PsaXBIoOjqxf */
-	XInitThreads();
-#endif
-	/* http://developer.gnome.org/gdk/stable/gdk-Threads.html */
-	g_thread_init(NULL);
-	gdk_threads_set_lock_functions(mtx_lock, mtx_unlock);
-	gdk_threads_init();
-	gdk_threads_enter();
-
-	/* http://www.gnupg.org/documentation/manuals/gcrypt/Multi_002dThreading.html */
-	gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
-#endif
 	gtk_init(&argc, &argv);
 
 	gnutls_global_init();
@@ -8788,12 +8652,6 @@ main(int argc, char **argv)
 
 	gtk_main();
 
-#ifdef USE_THREADS
-	GDK_FLUSH();
-	gdk_threads_leave();
-	g_static_rec_mutex_unlock_full(&my_gdk_mtx); /* just in case */
-#endif
-
 	gnutls_global_deinit();
 
 	if (url_regex)
0700 2141 - attempt to deal with slow networks' href='/akkartik/mu/commit/termbox/input.inl?h=main&id=1ed9af8300c037174dba4fc83fffeea9e6291ab8'>1ed9af83 ^
e709c65e ^

4d6b5173 ^


1ed9af83 ^
4d6b5173 ^




1ed9af83 ^
4d6b5173 ^




1ed9af83 ^
4d6b5173 ^




1ed9af83 ^
4d6b5173 ^

5cee5562 ^





e709c65e ^
1ed9af83 ^







5f128523 ^

8e7827df ^
5f128523 ^
9a31c34f ^



5f128523 ^
e709c65e ^




9a31c34f ^

1ed9af83 ^
4d6b5173 ^
1ed9af83 ^



9a31c34f ^
1ed9af83 ^

9a31c34f ^
5f128523 ^
9a31c34f ^

5f128523 ^
9a31c34f ^









5f128523 ^
9a31c34f ^
5f128523 ^
9a31c34f ^







5f128523 ^
9a31c34f ^


5f128523 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185