diff options
author | Benoit Foucher <benoit@zeroc.com> | 2016-01-05 11:56:55 +0100 |
---|---|---|
committer | Benoit Foucher <benoit@zeroc.com> | 2016-01-05 11:56:55 +0100 |
commit | 22403a2ad0d8921df9f4ec06f2571d251dbae3a6 (patch) | |
tree | f221ed8fd97017bc9afe13ac8bad62f1d7dfb5c2 /java/test | |
parent | Travis cleanup (diff) | |
download | ice-22403a2ad0d8921df9f4ec06f2571d251dbae3a6.tar.bz2 ice-22403a2ad0d8921df9f4ec06f2571d251dbae3a6.tar.xz ice-22403a2ad0d8921df9f4ec06f2571d251dbae3a6.zip |
Fixed potential deadlock that could occur with Ice for C++ when using collocation optimization and serialization
Diffstat (limited to 'java/test')
-rw-r--r-- | java/test/src/main/java/test/Ice/adapterDeactivation/AllTests.java | 3 | ||||
-rw-r--r-- | java/test/src/main/java/test/Ice/adapterDeactivation/Collocated.java | 10 |
2 files changed, 8 insertions, 5 deletions
diff --git a/java/test/src/main/java/test/Ice/adapterDeactivation/AllTests.java b/java/test/src/main/java/test/Ice/adapterDeactivation/AllTests.java index ea5cce04aeb..1b49cae4af9 100644 --- a/java/test/src/main/java/test/Ice/adapterDeactivation/AllTests.java +++ b/java/test/src/main/java/test/Ice/adapterDeactivation/AllTests.java @@ -44,7 +44,7 @@ public class AllTests { out.print("creating/destroying/recreating object adapter... "); out.flush(); - Ice.ObjectAdapter adapter = + Ice.ObjectAdapter adapter = communicator.createObjectAdapterWithEndpoints("TransientTestAdapter", "default"); try { @@ -66,6 +66,7 @@ public class AllTests out.print("creating/activating/deactivating object adapter in one operation... "); out.flush(); obj._transient(); + obj.end_transient(obj.begin_transient()); out.println("ok"); { diff --git a/java/test/src/main/java/test/Ice/adapterDeactivation/Collocated.java b/java/test/src/main/java/test/Ice/adapterDeactivation/Collocated.java index 8609cd895a7..7ca338b74ab 100644 --- a/java/test/src/main/java/test/Ice/adapterDeactivation/Collocated.java +++ b/java/test/src/main/java/test/Ice/adapterDeactivation/Collocated.java @@ -28,10 +28,12 @@ public class Collocated extends test.Util.Application { Ice.InitializationData initData = createInitializationData(); initData.properties = Ice.Util.createProperties(argsH); - if(initData.properties.getPropertyAsInt("Ice.ThreadInterruptSafe") > 0 || isAndroid()) - { - initData.properties.setProperty("Ice.ThreadPool.Server.Size", "2"); - } + + // + // 2 threads are necessary to dispatch the collocated transient() call with AMI + // + initData.properties.setProperty("TestAdapter.ThreadPool.Size", "2"); + initData.properties.setProperty("Ice.Package.Test", "test.Ice.adapterDeactivation"); initData.properties.setProperty("TestAdapter.Endpoints", "default -p 12010"); return initData; |