summaryrefslogtreecommitdiff
path: root/devel/glib20/files/patch-gthread_gthread-posix.c
diff options
context:
space:
mode:
authorJoe Marcus Clarke <marcus@FreeBSD.org>2004-07-27 19:45:37 +0000
committerJoe Marcus Clarke <marcus@FreeBSD.org>2004-07-27 19:45:37 +0000
commita7872c19bf63ad2f9118cab207197b1c859475d9 (patch)
treea24a587cd40d3850a65d616efe4c8322ce867943 /devel/glib20/files/patch-gthread_gthread-posix.c
parentUse the correct version of libtool 13 -> 15 to avoid install the *.la files. (diff)
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.
Notes
Notes: svn path=/head/; revision=114891
Diffstat (limited to 'devel/glib20/files/patch-gthread_gthread-posix.c')
-rw-r--r--devel/glib20/files/patch-gthread_gthread-posix.c34
1 files changed, 34 insertions, 0 deletions
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