summaryrefslogtreecommitdiff
path: root/cs/demo/Ice/async/WorkQueue.cs
diff options
context:
space:
mode:
Diffstat (limited to 'cs/demo/Ice/async/WorkQueue.cs')
-rw-r--r--cs/demo/Ice/async/WorkQueue.cs50
1 files changed, 0 insertions, 50 deletions
diff --git a/cs/demo/Ice/async/WorkQueue.cs b/cs/demo/Ice/async/WorkQueue.cs
index e818c9f8050..37cd4148352 100644
--- a/cs/demo/Ice/async/WorkQueue.cs
+++ b/cs/demo/Ice/async/WorkQueue.cs
@@ -33,22 +33,13 @@ public class WorkQueue
public void Run()
{
-#if COMPACT
- _m.Lock();
- try
-#else
lock(this)
-#endif
{
while(!_done)
{
if(_callbacks.Count == 0)
{
-#if COMPACT
- _m.Wait();
-#else
Monitor.Wait(this);
-#endif
}
if(_callbacks.Count != 0)
@@ -63,11 +54,7 @@ public class WorkQueue
// emulate a process that takes a significant period of
// time to complete.
//
-#if COMPACT
- _m.TimedWait(entry.delay);
-#else
Monitor.Wait(this, entry.delay);
-#endif
if(!_done)
{
@@ -86,22 +73,11 @@ public class WorkQueue
e.cb.ice_exception(new RequestCanceledException());
}
}
-#if COMPACT
- finally
- {
- _m.Unlock();
- }
-#endif
}
public void Add(AMD_Hello_sayHello cb, int delay)
{
-#if COMPACT
- _m.Lock();
- try
-#else
lock(this)
-#endif
{
if(!_done)
{
@@ -114,11 +90,7 @@ public class WorkQueue
if(_callbacks.Count == 0)
{
-#if COMPACT
- _m.Notify();
-#else
Monitor.Pulse(this);
-#endif
}
_callbacks.Add(entry);
}
@@ -130,40 +102,18 @@ public class WorkQueue
cb.ice_exception(new RequestCanceledException());
}
}
-#if COMPACT
- finally
- {
- _m.Unlock();
- }
-#endif
}
public void destroy()
{
-#if COMPACT
- _m.Lock();
- try
- {
- _done = true;
- _m.Notify();
- }
- finally
- {
- _m.Unlock();
- }
-#else
lock(this)
{
_done = true;
Monitor.Pulse(this);
}
-#endif
}
private ArrayList _callbacks = new ArrayList();
private bool _done = false;
private Thread thread_;
-#if COMPACT
- private readonly IceUtilInternal.Monitor _m = new IceUtilInternal.Monitor();
-#endif
}