Bug 312560 (MONO45980) - pthread_attr_setstacksize not available on NetBSD
Summary: pthread_attr_setstacksize not available on NetBSD
Status: RESOLVED FIXED
Alias: MONO45980
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords: build
Depends on:
Blocks:
 
Reported: 2003-07-08 19:04 UTC by Marc Recht
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 18:12:40 UTC


---- Reported by marc@informatik.uni-bremen.de 2003-07-08 12:04:47 MST ----

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);



---- Additional Comments From vargaz@freemail.hu 2003-10-13 14:43:57 MST ----

Fixed in CVS.


Unknown bug field "cf_op_sys_details" encountered while moving bug
   <cf_op_sys_details>NetBSD 1.6U</cf_op_sys_details>
Unknown operating system other. Setting to default OS "Other".