2010-07-15 Zoltan Varga <vargaz@gmail.com>
authorZoltan Varga <vargaz@gmail.com>
Thu, 15 Jul 2010 19:00:55 +0000 (19:00 -0000)
committerZoltan Varga <vargaz@gmail.com>
Thu, 15 Jul 2010 19:00:55 +0000 (19:00 -0000)
* wthreads.c (CreateThread): Avoid an assert if the stack size specified by the
caller is smaller than the system minimum.

svn path=/trunk/mono/; revision=160457

mono/io-layer/ChangeLog
mono/io-layer/wthreads.c

index 05ff9b3e997a5f0dfb7b3eb7a1acd1265e0b9687..4b576f7cbe06db7e4da494351519d33c121be8a0 100644 (file)
@@ -1,3 +1,8 @@
+2010-07-15  Zoltan Varga  <vargaz@gmail.com>
+
+       * wthreads.c (CreateThread): Avoid an assert if the stack size specified by the
+       caller is smaller than the system minimum.
+
 2010-06-29  Geoff Norton  <gnorton@novell.com>
 
        * atomics.h: Implement armv6+ variants of our atomics.
index bd768b99c55629da1c35ba6735572456a864667c..6615c317616ddba5a329cea033cc034d5d641469 100644 (file)
@@ -390,6 +390,11 @@ gpointer CreateThread(WapiSecurityAttributes *security G_GNUC_UNUSED, guint32 st
 #endif
        }
 
+#ifdef PTHREAD_STACK_MIN
+       if (stacksize < PTHREAD_STACK_MIN)
+               stacksize = PTHREAD_STACK_MIN;
+#endif
+
 #ifdef HAVE_PTHREAD_ATTR_SETSTACKSIZE
        thr_ret = pthread_attr_setstacksize(&attr, stacksize);
        g_assert (thr_ret == 0);