[Mono-bugs] [Bug 623477] Different behavior on Thread(ThreadEntryPoint, maxStackSize) on .net and mono

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Aug 16 06:18:44 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=623477

http://bugzilla.novell.com/show_bug.cgi?id=623477#c5


--- Comment #5 from Torello Querci <tquerci at gmail.com> 2010-08-16 10:18:43 UTC ---
New version of the patch. The previous one contains some error.


Index: class/corlib/System.Threading/Thread.cs
===================================================================
--- class/corlib/System.Threading/Thread.cs    (revisione 160737)
+++ class/corlib/System.Threading/Thread.cs    (copia locale)
@@ -976,8 +976,12 @@
         {
             if (start == null)
                 throw new ArgumentNullException ("start");
-            if (maxStackSize < 131072)
-                throw new ArgumentException ("< 128 kb", "maxStackSize");
+            if (maxStackSize < 0)
+                throw new ArgumentException ("< 0 kb", "maxStackSize");
+            if (maxStackSize < 262144)
+                maxStackSize = 262144;
+            if ((maxStackSize & 0xffff) != 0)
+                maxStackSize = (maxStackSize & 0xffff)+0x10000;

             threadstart = start;
             Internal.stack_size = maxStackSize;
@@ -995,8 +999,12 @@
         {
             if (start == null)
                 throw new ArgumentNullException ("start");
-            if (maxStackSize < 131072)
-                throw new ArgumentException ("< 128 kb", "maxStackSize");
+            if (maxStackSize < 0)
+                throw new ArgumentException ("< 0 kb", "maxStackSize");
+            if (maxStackSize < 262144)
+                maxStackSize = 262144;
+            if ((maxStackSize & 0xffff) != 0)
+                maxStackSize = (maxStackSize & 0xffff)+0x10000;

             threadstart = start;
             Internal.stack_size = maxStackSize;

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list