From a7872c19bf63ad2f9118cab207197b1c859475d9 Mon Sep 17 00:00:00 2001 From: Joe Marcus Clarke Date: Tue, 27 Jul 2004 19:45:37 +0000 Subject: [PATCH] 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/Makefile | 6 ++-- devel/glib20/files/patch-glib_gthread.h | 11 ------ .../files/patch-gthread_gthread-posix.c | 34 +++++++++++++++++++ 3 files changed, 37 insertions(+), 14 deletions(-) delete mode 100644 devel/glib20/files/patch-glib_gthread.h create mode 100644 devel/glib20/files/patch-gthread_gthread-posix.c diff --git a/devel/glib20/Makefile b/devel/glib20/Makefile index 7d9c6fbad65f..5e34e3f15210 100644 --- a/devel/glib20/Makefile +++ b/devel/glib20/Makefile @@ -7,7 +7,7 @@ PORTNAME= glib PORTVERSION= 2.4.4 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= ${MASTER_SITE_GNOME:S,%SUBDIR%,sources/${PORTNAME}/2.4,} \ ftp://ftp.gtk.org/pub/gtk/v2.3/ \ @@ -25,10 +25,10 @@ LATEST_LINK= glib20 USE_BZIP2= yes USE_GETTEXT= yes -USE_INC_LIBTOOL_VER=13 +USE_LIBTOOL_VER=15 USE_REINPLACE= yes INSTALLS_SHLIB= yes -USE_GNOME= gnomehack lthack gnometarget pkgconfig +USE_GNOME= gnomehack gnometarget pkgconfig USE_GMAKE= yes USE_PERL5= yes CONFIGURE_ARGS= --enable-static --with-libiconv=gnu \ diff --git a/devel/glib20/files/patch-glib_gthread.h b/devel/glib20/files/patch-glib_gthread.h deleted file mode 100644 index 70c24b36e21a..000000000000 --- a/devel/glib20/files/patch-glib_gthread.h +++ /dev/null @@ -1,11 +0,0 @@ ---- glib/gthread.h.orig Sat Jul 24 15:31:32 2004 -+++ glib/gthread.h Sat Jul 24 15:32:10 2004 -@@ -202,7 +202,7 @@ - #define g_thread_yield() G_THREAD_CF (thread_yield, (void)0, ()) - - #define g_thread_create(func, data, joinable, error) \ -- (g_thread_create_full (func, data, 0, joinable, FALSE, \ -+ (g_thread_create_full (func, data, 1024*256, joinable, FALSE, \ - G_THREAD_PRIORITY_NORMAL, error)) - - GThread* g_thread_create_full (GThreadFunc func, 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