From a7872c19bf63ad2f9118cab207197b1c859475d9 Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Tue, 27 Jul 2004 19:45:37 +0000 Subject: Remove the previous thread stack size hack, and add a slightly better one. This new hack sets a default thread stack size of 1 MB (more in line with Linux), but allows programmers to override that down to the minimum stack size. This is subject to change again, but this is far better than the hack that was previously in place. --- devel/glib20/files/patch-gthread_gthread-posix.c | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 devel/glib20/files/patch-gthread_gthread-posix.c (limited to 'devel/glib20/files/patch-gthread_gthread-posix.c') diff --git a/devel/glib20/files/patch-gthread_gthread-posix.c b/devel/glib20/files/patch-gthread_gthread-posix.c new file mode 100644 index 000000000000..e240b97729c3 --- /dev/null +++ b/devel/glib20/files/patch-gthread_gthread-posix.c @@ -0,0 +1,34 @@ +--- gthread/gthread-posix.c.orig Mon Nov 4 15:09:47 2002 ++++ gthread/gthread-posix.c Tue Jul 27 09:44:54 2004 +@@ -116,6 +116,7 @@ + #endif /* POSIX_MIN_PRIORITY && POSIX_MAX_PRIORITY */ + + static gulong g_thread_min_stack_size = 0; ++static gulong g_thread_default_stack_size = 0x100000; + + #define G_MUTEX_SIZE (sizeof (pthread_mutex_t)) + +@@ -125,7 +126,8 @@ + g_thread_impl_init() + { + #ifdef _SC_THREAD_STACK_MIN +- g_thread_min_stack_size = MAX (sysconf (_SC_THREAD_STACK_MIN), 0); ++ g_thread_min_stack_size = MAX (sysconf (_SC_THREAD_STACK_MIN), ++ g_thread_min_stack_size); + #endif /* _SC_THREAD_STACK_MIN */ + #ifdef HAVE_PRIORITIES + # ifdef G_THREADS_IMPL_POSIX +@@ -307,8 +309,12 @@ + if (stack_size) + { + stack_size = MAX (g_thread_min_stack_size, stack_size); +- posix_check_cmd (pthread_attr_setstacksize (&attr, stack_size)); + } ++ else ++ { ++ stack_size = MAX (g_thread_min_stack_size, g_thread_default_stack_size); ++ } ++ posix_check_cmd (pthread_attr_setstacksize (&attr, stack_size)); + #endif /* HAVE_PTHREAD_ATTR_SETSTACKSIZE */ + + #ifdef PTHREAD_SCOPE_SYSTEM -- cgit v1.2.3