[Mono-bugs] [Bug 34859][Wis] New - WaitHandle.WaitAny and WaitAll don't wait.

bugzilla-daemon@rocky.ximian.com bugzilla-daemon@rocky.ximian.com
2 Dec 2002 17:01:34 -0000


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 tum@veridicus.com.

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

--- shadow/34859	Mon Dec  2 12:01:34 2002
+++ shadow/34859.tmp.827	Mon Dec  2 12:01:34 2002
@@ -0,0 +1,73 @@
+Bug#: 34859
+Product: Mono/Runtime
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Wishlist
+Component: misc
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: tum@veridicus.com               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: WaitHandle.WaitAny and WaitAll don't wait.
+
+Please fill in this template when reporting a bug, unless you know what 
+you are doing.
+Description of Problem:
+
+WaitHandle.WaitAll and WaitHandle.WaitAny don't wait and return invalid 
+values.
+
+Steps to reproduce the problem:
+
+Compile and run the following code:
+
+using System;
+using System.Threading;
+
+class Test
+{
+	public static void Main()
+	{
+		ManualResetEvent w1, w2;
+
+		w1 = new ManualResetEvent(false);		
+		w2 = new ManualResetEvent(true);		
+
+		// Prints -1.  Should print 1.
+		Console.WriteLine(WaitHandle.WaitAny(new WaitHandle[]
+{w1,w2}));
+
+		w1.Set();
+		w2.Set();
+
+		// Prints false.  Should print true.
+		Console.WriteLine(WaitHandle.WaitAll(new WaitHandle[]
+{w1,w2}));
+	}
+}
+
+
+Actual Results:
+
+-1
+false
+
+Expected Results:
+
+1
+true
+
+How often does this happen? 
+
+All the time.
+
+Additional Information:
+
+WaitHandle.WaitOne appears to work fine.  The problem also occurs if 
+AutoResetEvent are used.