1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-12-27 05:10:36 +00:00

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.
This commit is contained in:
Joe Marcus Clarke 2004-07-27 19:45:37 +00:00
parent e64aa26f70
commit a7872c19bf
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=114891
3 changed files with 37 additions and 14 deletions

View File

@ -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 \

View File

@ -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,

View File

@ -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