Merge branch 'master' into msbuilddll2
[mono.git] / mcs / class / corlib / System.Threading / CancellationTokenSource.cs
index f8987f279e83d0d2551a8aaed5b3342ad75a86d8..59637dd0a35e212c5685648d6c1c78d8501bc5ed 100644 (file)
@@ -26,7 +26,7 @@
 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 // THE SOFTWARE.
 
-#if NET_4_0 || MOBILE
+#if NET_4_0
 using System.Collections.Generic;
 using System.Collections.Concurrent;
 
@@ -133,7 +133,7 @@ namespace System.Threading
                        
                        try {
                                Action cb;
-                               for (int id = int.MinValue + 1; id <= currId; id++) {
+                               for (int id = currId; id != int.MinValue; id--) {
                                        if (!callbacks.TryRemove (new CancellationTokenRegistration (id, this), out cb))
                                                continue;
                                        if (cb == null)