summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/httpd.c b/httpd.c
index 258f788..ee1ecb7 100644
--- a/httpd.c
+++ b/httpd.c
@@ -293,16 +293,16 @@ void job_wait(xs_val **job)
293static void *job_thread(void *arg) 293static void *job_thread(void *arg)
294/* job thread */ 294/* job thread */
295{ 295{
296 long long pid = (long long)arg; 296 int pid = (char *) arg - (char *) 0x0;
297 297
298 srv_debug(1, xs_fmt("job thread %ld started", pid)); 298 srv_debug(1, xs_fmt("job thread %d started", pid));
299 299
300 for (;;) { 300 for (;;) {
301 xs *job = NULL; 301 xs *job = NULL;
302 302
303 job_wait(&job); 303 job_wait(&job);
304 304
305 srv_debug(1, xs_fmt("job thread %ld wake up", pid)); 305 srv_debug(1, xs_fmt("job thread %d wake up", pid));
306 306
307 if (job == NULL) 307 if (job == NULL)
308 break; 308 break;
@@ -322,7 +322,7 @@ static void *job_thread(void *arg)
322 } 322 }
323 } 323 }
324 324
325 srv_debug(1, xs_fmt("job thread %ld stopped", pid)); 325 srv_debug(1, xs_fmt("job thread %d stopped", pid));
326 326
327 return NULL; 327 return NULL;
328} 328}
@@ -441,8 +441,9 @@ void httpd(void)
441 pthread_create(&threads[0], NULL, background_thread, NULL); 441 pthread_create(&threads[0], NULL, background_thread, NULL);
442 442
443 /* the rest of threads are for job processing */ 443 /* the rest of threads are for job processing */
444 char *ptr = (char *) 0x1;
444 for (n = 1; n < n_threads; n++) 445 for (n = 1; n < n_threads; n++)
445 pthread_create(&threads[n], NULL, job_thread, (void *)(long long)n); 446 pthread_create(&threads[n], NULL, job_thread, ptr++);
446 447
447 if (setjmp(on_break) == 0) { 448 if (setjmp(on_break) == 0) {
448 for (;;) { 449 for (;;) {