From cb96c0dcc28bc37db1a90d3523ff9c2fe6c41047 Mon Sep 17 00:00:00 2001 From: Xavier Roche Date: Sun, 12 May 2013 14:39:07 +0000 Subject: webhttrack: use 8MB for the stack size (needed especially for OSX). should get rid of http://code.google.com/p/httrack/issues/detail?id=10 --- src/htsthread.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/htsthread.c b/src/htsthread.c index 35744de..6e6a805 100644 --- a/src/htsthread.c +++ b/src/htsthread.c @@ -142,9 +142,13 @@ HTSEXT_API int hts_newthread( void (*fun)(void *arg), void *arg) } #else { + const size_t stackSize = 1024*1024*8; + pthread_attr_t attr; pthread_t handle = 0; - int retcode = pthread_create(&handle, NULL, hts_entry_point, s_args); - if (retcode != 0) { /* error */ + int retcode; + if (pthread_attr_init(&attr) != 0 + || pthread_attr_setstacksize(&attr, stackSize) != 0 + || (retcode = pthread_create(&handle, &attr, hts_entry_point, s_args)) != 0) { free(s_args); return -1; } else { -- cgit v1.2.3