[Mono-bugs] [Bug 45980][Nor] New - pthread_attr_setstacksize not available on NetBSD

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
Tue, 8 Jul 2003 12:04:47 -0400 (EDT)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by marc@informatik.uni-bremen.de.

http://bugzilla.ximian.com/show_bug.cgi?id=45980

--- shadow/45980	Tue Jul  8 12:04:47 2003
+++ shadow/45980.tmp.1560	Tue Jul  8 12:04:47 2003
@@ -0,0 +1,56 @@
+Bug#: 45980
+Product: Mono/Runtime
+Version: unspecified
+OS: other
+OS Details: NetBSD 1.6U
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Normal
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: marc@informatik.uni-bremen.de               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: pthread_attr_setstacksize not available on NetBSD
+
+pthread_attr_setstacksize is optional wrt to the POSIX thread spec. It's
+not (yet) implemented on NetBSD(-current) and there may be more systems.
+The attached patch let's configure check for it and only use it if it's
+available.
+
+Index: configure.in
+===================================================================
+RCS file: /mono/mono/configure.in,v
+retrieving revision 1.148
+diff -u -u -b -r1.148 configure.in
+--- configure.in	2 Jul 2003 08:37:29 -0000	1.148
++++ configure.in	8 Jul 2003 15:58:57 -0000
+@@ -469,6 +469,7 @@
+ 		AC_MSG_WARN(Using mono_mutex_t for recursive mutexes)
+ 		AC_DEFINE(USE_MONO_MUTEX)
+ 	])
++	AC_CHECK_FUNCS(pthread_attr_setstacksize)
+ 
+ 	dnl ********************************
+ 	dnl *** Checks for semaphore lib ***
+Index: mono/io-layer/threads.c
+===================================================================
+RCS file: /mono/mono/mono/io-layer/threads.c,v
+retrieving revision 1.45
+diff -u -u -b -r1.45 threads.c
+--- mono/io-layer/threads.c	4 Jul 2003 18:45:33 -0000	1.45
++++ mono/io-layer/threads.c	8 Jul 2003 15:59:02 -0000
+@@ -238,8 +238,9 @@
+ 	 * I'm leaving it as 2M until I'm told differently.)
+ 	 */
+ 	pthread_attr_init(&attr);
++#ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
+ 	pthread_attr_setstacksize(&attr, 1024*1024*2);
+-
++#endif
+ 	ret=_wapi_timed_thread_create(&thread_private_handle->thread, &attr,
+ 				      create, start, thread_exit, param,
+ 				      handle);