Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenrik Rentz-Reichert2016-11-21 20:38:10 +0000
committerHenrik Rentz-Reichert2016-11-21 20:38:10 +0000
commit0e349e78bdf554a49fc35739e2b1ecc865f4fe3e (patch)
tree84097ff984033a85e509a40b269bc7f7be93f4dc /plugins/org.eclipse.etrice.generator.cpp
parentaaef21c8059b4b00d2088600fb77a6ebedf38fdf (diff)
downloadorg.eclipse.etrice-0e349e78bdf554a49fc35739e2b1ecc865f4fe3e.tar.gz
org.eclipse.etrice-0e349e78bdf554a49fc35739e2b1ecc865f4fe3e.tar.xz
org.eclipse.etrice-0e349e78bdf554a49fc35739e2b1ecc865f4fe3e.zip
Bug 348173 - message services should be started according to thread prio
* generated code for creating and adding message services is sorted in descending priority * runtimes changed to consider order Change-Id: I5d2043fdbd8f4b9657b92e2f2cb7785b07849019
Diffstat (limited to 'plugins/org.eclipse.etrice.generator.cpp')
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend2
-rw-r--r--plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java10
2 files changed, 10 insertions, 2 deletions
diff --git a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
index 7ac206db5..48a98f833 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
+++ b/plugins/org.eclipse.etrice.generator.cpp/src/org/eclipse/etrice/generator/cpp/gen/NodeGen.xtend
@@ -234,7 +234,7 @@ class NodeGen {
«ENDIF»
IMessageMemory* msgMemory;
- «FOR thread: threads»
+ «FOR thread: threads.sortBy[-prio]»
{
msgMemory = new StaticMessageMemory(this, "MessageMemory_«thread.name»", «thread.msgblocksize», «thread.msgpoolsize»);
«IF thread.execmode==ExecMode::POLLED || thread.execmode==ExecMode::MIXED»
diff --git a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java
index f93f1f980..8b127a7db 100644
--- a/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java
+++ b/plugins/org.eclipse.etrice.generator.cpp/xtend-gen/org/eclipse/etrice/generator/cpp/gen/NodeGen.java
@@ -574,7 +574,15 @@ public class NodeGen {
_builder.append("IMessageMemory* msgMemory;");
_builder.newLine();
{
- for(final PhysicalThread thread_3 : threads) {
+ final Function1<PhysicalThread, Long> _function_1 = new Function1<PhysicalThread, Long>() {
+ @Override
+ public Long apply(final PhysicalThread it) {
+ long _prio = it.getPrio();
+ return Long.valueOf((-_prio));
+ }
+ };
+ List<PhysicalThread> _sortBy = IterableExtensions.<PhysicalThread, Long>sortBy(threads, _function_1);
+ for(final PhysicalThread thread_3 : _sortBy) {
_builder.append("\t");
_builder.append("{");
_builder.newLine();

Back to the top