diff options
author | Matthew Newhook <matthew@zeroc.com> | 2014-07-17 16:24:07 -0230 |
---|---|---|
committer | Matthew Newhook <matthew@zeroc.com> | 2014-07-17 16:24:07 -0230 |
commit | 336bf8e9dce7433e29b5aaa69886684ff6f9fc0d (patch) | |
tree | 17dd838b844ab7d707718352e355858dcfe2395e /cs/src/Ice/AsyncIOThread.cs | |
parent | ICE-5316 Add support for InputStream::pos() method (diff) | |
download | ice-336bf8e9dce7433e29b5aaa69886684ff6f9fc0d.tar.bz2 ice-336bf8e9dce7433e29b5aaa69886684ff6f9fc0d.tar.xz ice-336bf8e9dce7433e29b5aaa69886684ff6f9fc0d.zip |
- Removed support for .NET CF 3.5, replaced with support for .NET
CF 3.9.
- Removed IceUtilInternal.Monitor.
Diffstat (limited to 'cs/src/Ice/AsyncIOThread.cs')
-rw-r--r-- | cs/src/Ice/AsyncIOThread.cs | 35 |
1 files changed, 7 insertions, 28 deletions
diff --git a/cs/src/Ice/AsyncIOThread.cs b/cs/src/Ice/AsyncIOThread.cs index 2a8fce23ff0..91d15a94201 100644 --- a/cs/src/Ice/AsyncIOThread.cs +++ b/cs/src/Ice/AsyncIOThread.cs @@ -42,8 +42,7 @@ namespace IceInternal public void updateObserver() { - _m.Lock(); - try + lock(this) { Ice.Instrumentation.CommunicatorObserver obsv = _instance.getObserver(); if(obsv != null) @@ -57,40 +56,26 @@ namespace IceInternal _observer.attach(); } } - } - finally - { - _m.Unlock(); } } public void queue(ThreadPoolWorkItem callback) { - _m.Lock(); - try + lock(this) { Debug.Assert(!_destroyed); _queue.AddLast(callback); - _m.Notify(); - } - finally - { - _m.Unlock(); + System.Threading.Monitor.Pulse(this); } } public void destroy() { - _m.Lock(); - try + lock(this) { Debug.Assert(!_destroyed); _destroyed = true; - _m.Notify(); - } - finally - { - _m.Unlock(); + System.Threading.Monitor.Pulse(this); } } @@ -108,8 +93,7 @@ namespace IceInternal bool inUse = false; while(true) { - _m.Lock(); - try + lock(this) { if(_observer != null && inUse) { @@ -125,7 +109,7 @@ namespace IceInternal while(!_destroyed && _queue.Count == 0) { - _m.Wait(); + System.Threading.Monitor.Wait(this); } LinkedList<ThreadPoolWorkItem> tmp = queue; @@ -139,10 +123,6 @@ namespace IceInternal inUse = true; } } - finally - { - _m.Unlock(); - } foreach(ThreadPoolWorkItem cb in queue) { @@ -224,6 +204,5 @@ namespace IceInternal } private HelperThread _thread; - private readonly IceUtilInternal.Monitor _m = new IceUtilInternal.Monitor(); } } |