瀏覽代碼

2003-04-17 Pedro Mart�nez Juli� <[email protected]>

    * Timer.cs: Change the position of two lines because they were
    before the "if" that ensures the integrity. After this, the first of
    that two lines was producing a NullReferenceException.

svn path=/trunk/mcs/; revision=13737
Pedro Martínez Juliá 23 年之前
父節點
當前提交
f2d32eb17c
共有 2 個文件被更改,包括 9 次插入2 次删除
  1. 6 0
      mcs/class/corlib/System.Threading/ChangeLog
  2. 3 2
      mcs/class/corlib/System.Threading/Timer.cs

+ 6 - 0
mcs/class/corlib/System.Threading/ChangeLog

@@ -1,3 +1,9 @@
+2003-04-17  Pedro Martínez Juliá  <[email protected]>
+
+	* Timer.cs: Change the position of two lines because they were
+	before the "if" that ensures the integrity. After this, the first of
+	that two lines was producing a NullReferenceException.
+
 2003-04-09  Dick Porter  <[email protected]>
 
 	* Thread.cs: Make sure a reference to the ThreadStart delegate is

+ 3 - 2
mcs/class/corlib/System.Threading/Timer.cs

@@ -85,14 +85,15 @@ namespace System.Threading
 
 					bool signaled = false;
 					while (true) {
-						wait.Reset ();
-						signaled = wait.WaitOne (period, false);
 						if (disposed)
 							return;
 
 						if (aborted)
 							break;
 
+						wait.Reset ();
+						signaled = wait.WaitOne (period, false);
+
 						if (!signaled) {
 							callback (state);
 						} else if (!WaitForDueTime ()) {