aboutsummaryrefslogtreecommitdiff
path: root/docs/examples/smooth-gtk-thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'docs/examples/smooth-gtk-thread.c')
-rw-r--r--docs/examples/smooth-gtk-thread.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/docs/examples/smooth-gtk-thread.c b/docs/examples/smooth-gtk-thread.c
index 5a4f18fd9..66d8c10b5 100644
--- a/docs/examples/smooth-gtk-thread.c
+++ b/docs/examples/smooth-gtk-thread.c
@@ -68,7 +68,6 @@ size_t write_file(void *ptr, size_t size, size_t nmemb, FILE *stream)
void *pull_one_url(void *NaN)
{
CURL *curl;
- CURLcode res;
gchar *http;
FILE *outfile;
@@ -98,7 +97,7 @@ void *pull_one_url(void *NaN)
j++; /* critical line */
pthread_mutex_unlock(&lock);
- res = curl_easy_perform(curl);
+ curl_easy_perform(curl);
fclose(outfile);
printf("fclose\n");
@@ -131,14 +130,13 @@ void *create_thread(void *progress_bar)
{
pthread_t tid[NUMT];
int i;
- int error;
/* Make sure I don't create more threads than urls. */
for(i = 0; i < NUMT && i < num_urls ; i++) {
- error = pthread_create(&tid[i],
- NULL, /* default attributes please */
- pull_one_url,
- NULL);
+ int error = pthread_create(&tid[i],
+ NULL, /* default attributes please */
+ pull_one_url,
+ NULL);
if(0 != error)
fprintf(stderr, "Couldn't run thread number %d, errno %d\n", i, error);
else
@@ -147,7 +145,7 @@ void *create_thread(void *progress_bar)
/* Wait for all threads to terminate. */
for(i = 0; i < NUMT && i < num_urls; i++) {
- error = pthread_join(tid[i], NULL);
+ pthread_join(tid[i], NULL);
fprintf(stderr, "Thread %d terminated\n", i);
}