head	1.4;
access;
symbols
	RELEASE_8_3_0:1.4
	RELEASE_9_0_0:1.4
	RELEASE_7_4_0:1.4
	RELEASE_8_2_0:1.4
	RELEASE_6_EOL:1.4
	RELEASE_8_1_0:1.3
	RELEASE_7_3_0:1.3
	RELEASE_8_0_0:1.3
	RELEASE_7_2_0:1.3
	RELEASE_7_1_0:1.3
	RELEASE_6_4_0:1.3
	RELEASE_5_EOL:1.3
	RELEASE_7_0_0:1.3
	RELEASE_6_3_0:1.3
	PRE_XORG_7:1.3
	RELEASE_4_EOL:1.3
	RELEASE_6_2_0:1.3
	RELEASE_6_1_0:1.3
	RELEASE_5_5_0:1.3
	RELEASE_6_0_0:1.3
	RELEASE_5_4_0:1.3
	RELEASE_4_11_0:1.3
	RELEASE_5_3_0:1.2
	RELEASE_4_10_0:1.2
	RELEASE_5_2_1:1.2
	RELEASE_5_2_0:1.2
	RELEASE_4_9_0:1.2
	RELEASE_5_1_0:1.2
	RELEASE_4_8_0:1.2
	RELEASE_5_0_0:1.1
	RELEASE_4_7_0:1.1
	RELEASE_4_6_2:1.1
	RELEASE_4_6_1:1.1
	RELEASE_4_6_0:1.1
	RELEASE_5_0_DP1:1.1
	RELEASE_4_5_0:1.1
	RELEASE_4_4_0:1.1
	RELEASE_4_3_0:1.1
	RELEASE_4_2_0:1.1
	RELEASE_4_1_1:1.1;
locks; strict;
comment	@# @;


1.4
date	2010.10.16.09.17.20;	author sunpoet;	state Exp;
branches;
next	1.3;

1.3
date	2004.12.20.09.25.39;	author krion;	state Exp;
branches;
next	1.2;

1.2
date	2003.02.02.13.32.37;	author nork;	state Exp;
branches;
next	1.1;

1.1
date	2000.07.20.07.32.29;	author alex;	state Exp;
branches;
next	;


desc
@@


1.4
log
@- Eliminate coredump on amd64
- Bump PORTREVISION

PR:		ports/151436
Submitted by:	Dmitry Pryanishnikov <lynx.ripe@@gmail.com>
Approved by:	pgollucci (mentor, implicit)
@
text
@--- gwlib/gwthread-pthread.c.orig	Thu Aug 12 19:53:30 2004
+++ gwlib/gwthread-pthread.c	Mon Dec 20 00:53:57 2004
@@@@ -125,6 +125,11 @@@@
 static pthread_key_t tsd_key;
 
 static pthread_mutex_t threadtable_lock;
+/*
+ * Thread creation parameters.
+ */
+static pthread_attr_t thread_attr;
+#define MIN_THREAD_STACK_SIZE (256 * 1024)
 
 static void lock(void)
 {
@@@@ -263,6 +268,7 @@@@
 {
     int ret;
     int i;
+    size_t stack_size;
 
     pthread_mutex_init(&threadtable_lock, NULL);
 
@@@@ -275,6 +281,13 @@@@
         threadtable[i] = NULL;
     }
     active_threads = 0;
+/*
+ * Make sure that thread stack is large enough.
+ */
+    pthread_attr_init(&thread_attr);
+    pthread_attr_getstacksize(&thread_attr, &stack_size);
+    if (stack_size < MIN_THREAD_STACK_SIZE)
+            pthread_attr_setstacksize(&thread_attr, MIN_THREAD_STACK_SIZE);
 
     create_threadinfo_main();
 }
@@@@ -443,7 +456,7 @@@@
         return -1;
     }
 
-    ret = pthread_create(&id, NULL, &new_thread, p);
+    ret = pthread_create(&id, &thread_attr, &new_thread, p);
     if (ret != 0) {
         unlock();
         error(ret, "Could not create new thread.");
@


1.3
log
@Update to version 1.4.0

PR:		ports/75271
Submitted by:	Ports Fury
@
text
@d19 1
a19 1
+    int stack_size;
@


1.2
log
@Update to 1.2.1.

PR:		ports/47332
Submitted by:	Ports Fury
@
text
@d1 4
a4 4
--- gwlib/gwthread-pthread.c.orig	Wed Sep  4 18:11:06 2002
+++ gwlib/gwthread-pthread.c	Sun Jan 19 03:05:30 2003
@@@@ -68,6 +68,11 @@@@
 pthread_key_t tsd_key;
d6 1
a6 1
 pthread_mutex_t threadtable_lock;
d15 1
a15 1
@@@@ -205,6 +210,7 @@@@
d23 1
a23 1
@@@@ -217,6 +223,13 @@@@
d37 1
a37 1
@@@@ -380,7 +393,7 @@@@
@


1.1
log
@Fix bug, when WAP-mobiles finally try to request a page.
This patch raises the pthread stack default size and compiles
the port with -pthread.

While I'm here, add closing ' for sed-regexp (thanks ViM syntax highlighting!)

Submitted by:	"Ari Suutari" <ari@@suutari.iki.fi>
@
text
@d1 45
a45 59
*** gwlib/gwthread-pthread.c.orig	Tue Jul 18 15:08:24 2000
--- gwlib/gwthread-pthread.c	Wed Jul 19 13:23:39 2000
***************
*** 58,63 ****
--- 58,68 ----
  pthread_key_t tsd_key;
  
  pthread_mutex_t threadtable_lock;
+ /*
+  * Thread creation parameters.
+  */
+ static pthread_attr_t	thread_attr;
+ #define MIN_THREAD_STACK_SIZE	(256 * 1024)
  
  static void lock(void) {
  	int ret;
***************
*** 172,177 ****
--- 177,183 ----
  void gwthread_init(void) {
  	int ret;
  	int i;
+ 	int stack_size;
  
  	pthread_mutex_init(&threadtable_lock, NULL);
  
***************
*** 184,189 ****
--- 190,202 ----
  		threadtable[i] = NULL;
  	}
  	active_threads = 0;
+ /*
+  * Make sure that thread stack is large enough.
+  */
+ 	pthread_attr_init(&thread_attr);
+ 	pthread_attr_getstacksize(&thread_attr, &stack_size);
+ 	if (stack_size < MIN_THREAD_STACK_SIZE)
+ 		pthread_attr_setstacksize(&thread_attr, MIN_THREAD_STACK_SIZE);
  
  	create_threadinfo_main();
  }
***************
*** 285,291 ****
  		return -1;
  	}
  
! 	ret = pthread_create(&id, NULL, &new_thread, p);
  	if (ret != 0) {
  		unlock();
  		error(ret, "Could not create new thread.");
--- 298,304 ----
  		return -1;
  	}
  
! 	ret = pthread_create(&id, &thread_attr, &new_thread, p);
  	if (ret != 0) {
  		unlock();
  		error(ret, "Could not create new thread.");
@

