aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/smooth-gtk-thread.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-04-03 20:28:32 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-04-03 20:28:32 +0000
commitbf52cef16fd2cc1ad83f760059d27f49f036c3eb (patch)
tree8cc62150d2ff3c5662130f0490cd720d5a5a62dc /docs/examples/smooth-gtk-thread.c
parent16a9c5e02be15c1dde3aa21b3ced5a71c6fae53c (diff)
Made sure that curl_global_init is called in all the multithreaded
example programs.
Diffstat (limited to 'docs/examples/smooth-gtk-thread.c')
-rw-r--r--docs/examples/smooth-gtk-thread.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c
index 271939cea..2d41aa248 100644
--- a/docs/examples/smooth-gtk-thread.c
+++ b/docs/examples/smooth-gtk-thread.c
@@ -33,7 +33,7 @@
pthread_mutex_t lock = PTHREAD_MUTEX_INITIALIZER;
int j = 0;
gint num_urls = 9; /* Just make sure this is less than urls[]*/
-char *urls[]= {
+const char * const urls[]= {
"90022",
"90023",
"90024",
@@ -58,7 +58,6 @@ void *pull_one_url(void *NaN)
CURLcode res;
gchar *http;
FILE *outfile;
- gint i;
/* Stop threads from entering unless j is incremented */
pthread_mutex_lock(&lock);
@@ -167,7 +166,9 @@ static gboolean cb_delete(GtkWidget *window, gpointer data)
int main(int argc, char **argv)
{
GtkWidget *top_window, *outside_frame, *inside_frame, *progress_bar;
- GtkAdjustment *adj;
+
+ /* Must initialize libcurl before any threads are started */
+ curl_global_init(CURL_GLOBAL_ALL);
/* Init thread */
g_thread_init(NULL);