diff options
Diffstat (limited to 'csharp/test/Ice/dispatcher/Dispatcher.cs')
-rw-r--r-- | csharp/test/Ice/dispatcher/Dispatcher.cs | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/csharp/test/Ice/dispatcher/Dispatcher.cs b/csharp/test/Ice/dispatcher/Dispatcher.cs index a5caa9eca24..4bd201c88df 100644 --- a/csharp/test/Ice/dispatcher/Dispatcher.cs +++ b/csharp/test/Ice/dispatcher/Dispatcher.cs @@ -7,9 +7,7 @@ // // ********************************************************************** -using System; using System.Diagnostics; -using System.Reflection; using System.Collections.Generic; using System.Threading; @@ -35,16 +33,12 @@ public class Dispatcher { while(true) { -#if COMPACT - Ice.VoidAction call = null; -#else System.Action call = null; -#endif lock(_m) { if(!_terminated && _calls.Count == 0) { - System.Threading.Monitor.Wait(_m); + Monitor.Wait(_m); } if(_calls.Count > 0) @@ -73,18 +67,14 @@ public class Dispatcher } } -#if COMPACT - public void dispatch(Ice.VoidAction call, Ice.Connection con) -#else public void dispatch(System.Action call, Ice.Connection con) -#endif { lock(_m) { _calls.Enqueue(call); if(_calls.Count == 1) { - System.Threading.Monitor.Pulse(_m); + Monitor.Pulse(_m); } } } @@ -94,7 +84,7 @@ public class Dispatcher lock(_m) { _instance._terminated = true; - System.Threading.Monitor.Pulse(_m); + Monitor.Pulse(_m); } _instance._thread.Join(); @@ -107,11 +97,7 @@ public class Dispatcher static Dispatcher _instance; -#if COMPACT - private Queue<Ice.VoidAction> _calls = new Queue<Ice.VoidAction>(); -#else private Queue<System.Action> _calls = new Queue<System.Action>(); -#endif Thread _thread; bool _terminated = false; private static readonly object _m = new object(); |