summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/httpd.c b/httpd.c
index 5f6be27..3e4eb7d 100644
--- a/httpd.c
+++ b/httpd.c
@@ -368,16 +368,16 @@ void job_wait(xs_val **job)
368static void *job_thread(void *arg) 368static void *job_thread(void *arg)
369/* job thread */ 369/* job thread */
370{ 370{
371 int pid = pthread_self(); 371 long long pid = (long long)arg;
372 372
373 srv_debug(0, xs_fmt("job thread %x started", pid)); 373 srv_debug(0, xs_fmt("job thread %ld started", pid));
374 374
375 for (;;) { 375 for (;;) {
376 xs *job = NULL; 376 xs *job = NULL;
377 377
378 job_wait(&job); 378 job_wait(&job);
379 379
380 srv_debug(0, xs_fmt("job thread %x wake up", pid)); 380 srv_debug(0, xs_fmt("job thread %ld wake up", pid));
381 381
382 if (job == NULL) 382 if (job == NULL)
383 break; 383 break;
@@ -393,7 +393,7 @@ static void *job_thread(void *arg)
393 } 393 }
394 } 394 }
395 395
396 srv_debug(0, xs_fmt("job thread %x stopped", pid)); 396 srv_debug(0, xs_fmt("job thread %ld stopped", pid));
397 397
398 return NULL; 398 return NULL;
399} 399}
@@ -405,7 +405,7 @@ void httpd(void)
405 char *address; 405 char *address;
406 int port; 406 int port;
407 int rs; 407 int rs;
408 pthread_t threads[MAX_THREADS]; 408 pthread_t threads[MAX_THREADS] = {0};
409 int n_threads = 0; 409 int n_threads = 0;
410 int n; 410 int n;
411 411
@@ -448,7 +448,7 @@ void httpd(void)
448 448
449 /* the rest of threads are for job processing */ 449 /* the rest of threads are for job processing */
450 for (n = 1; n < n_threads; n++) 450 for (n = 1; n < n_threads; n++)
451 pthread_create(&threads[n], NULL, job_thread, NULL); 451 pthread_create(&threads[n], NULL, job_thread, (void *)(long long)n);
452 452
453 if (setjmp(on_break) == 0) { 453 if (setjmp(on_break) == 0) {
454 for (;;) { 454 for (;;) {