diff options
author | Mark Spruiell <mes@zeroc.com> | 2017-01-30 13:45:21 -0800 |
---|---|---|
committer | Mark Spruiell <mes@zeroc.com> | 2017-01-30 13:45:21 -0800 |
commit | 61270a10f980933cf582edb766f10c8ac6d86e8a (patch) | |
tree | 45ab4a7c2986954054fce613bc3c8f7967e7951e /csharp/test/Ice/acm/TestI.cs | |
parent | Fix slice2cpp build failure (diff) | |
download | ice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.bz2 ice-61270a10f980933cf582edb766f10c8ac6d86e8a.tar.xz ice-61270a10f980933cf582edb766f10c8ac6d86e8a.zip |
merging IceBridge into master
Diffstat (limited to 'csharp/test/Ice/acm/TestI.cs')
-rw-r--r-- | csharp/test/Ice/acm/TestI.cs | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/csharp/test/Ice/acm/TestI.cs b/csharp/test/Ice/acm/TestI.cs index 0dd3455daf7..970c1c22148 100644 --- a/csharp/test/Ice/acm/TestI.cs +++ b/csharp/test/Ice/acm/TestI.cs @@ -34,7 +34,8 @@ public class RemoteCommunicatorI : RemoteCommunicatorDisp_ } properties.setProperty(name + ".ThreadPool.Size", "2"); Ice.ObjectAdapter adapter = com.createObjectAdapterWithEndpoints(name, protocol + " -h \"" + host + "\""); - return RemoteObjectAdapterPrxHelper.uncheckedCast(current.adapter.addWithUUID(new RemoteObjectAdapterI(adapter))); + return RemoteObjectAdapterPrxHelper.uncheckedCast( + current.adapter.addWithUUID(new RemoteObjectAdapterI(adapter))); } public override void @@ -42,7 +43,7 @@ public class RemoteCommunicatorI : RemoteCommunicatorDisp_ { current.adapter.getCommunicator().shutdown(); } -}; +} public class RemoteObjectAdapterI : RemoteObjectAdapterDisp_ { @@ -82,7 +83,7 @@ public class RemoteObjectAdapterI : RemoteObjectAdapterDisp_ private Ice.ObjectAdapter _adapter; private TestIntfPrx _testIntf; -}; +} public class TestI : TestIntfDisp_ { @@ -117,7 +118,7 @@ public class TestI : TestIntfDisp_ { lock(this) { - --_count; + ++_count; System.Threading.Monitor.PulseAll(this); } } @@ -126,8 +127,7 @@ public class TestI : TestIntfDisp_ { lock(this) { - _count = count; - while(_count > 0) + while(_count < count) { System.Threading.Monitor.Wait(this); } @@ -135,14 +135,19 @@ public class TestI : TestIntfDisp_ } private int _count = 0; - }; + } - public override void waitForHeartbeat(int count, Ice.Current current) + public override void startHeartbeatCount(Ice.Current current) { + _callback = new HeartbeatCallbackI(); + current.con.setHeartbeatCallback(_callback.heartbeat); + } - - HeartbeatCallbackI callback = new HeartbeatCallbackI(); - current.con.setHeartbeatCallback(callback.heartbeat); - callback.waitForCount(count); + public override void waitForHeartbeatCount(int count, Ice.Current current) + { + System.Diagnostics.Debug.Assert(_callback != null); + _callback.waitForCount(count); } -}; + + private HeartbeatCallbackI _callback; +} |