From 1bcfad877a58b2112a630bfee1b87dda166f9250 Mon Sep 17 00:00:00 2001 From: Juergen Gehring Date: Thu, 25 Jan 2018 01:03:00 -0800 Subject: [PATCH] capicxx-core-tools 3.1.12.1 --- .gitattributes | 42 ------------------- .gitignore | 2 - .project | 27 ------------ CHANGES | 4 ++ .../generator/FInterfaceStubGenerator.xtend | 34 ++++++++++++++- .../generator/FTypeCommonAreaGenerator.xtend | 2 +- 6 files changed, 37 insertions(+), 74 deletions(-) delete mode 100644 .gitattributes delete mode 100644 .gitignore delete mode 100644 .project diff --git a/.gitattributes b/.gitattributes deleted file mode 100644 index 4204714..0000000 --- a/.gitattributes +++ /dev/null @@ -1,42 +0,0 @@ -# set default behaviour, in case users don't have core.autocrlf set. -* text eol=lf - -# Explicitly declare text files we want to always be normalized and converted -# to native line endings on checkout. -*.am text -*.ac text -*.m4 text -*.in text - -*.c text -*.cpp text -*.h text -*.hpp text - -*.fidl text -*.java text -*.xtend text - -*.html text -*.xml text - -*.properties text - -AUTHORS text -LICENSE text -README text - -# Eclipse -.autotools text -.cproject text -.project text -org.eclipse.core.resources.prefs text -*.MF text - -# Declare files that will always have CRLF line endings on checkout. -*.sln text eol=crlf - -# Denote all files that are truly binary and should not be modified. -*.png binary -*.jpg binary -*.jar binary diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 5ff9c22..0000000 --- a/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -CommonAPI-Examples/src-gen -doc diff --git a/.project b/.project deleted file mode 100644 index 1baaaa2..0000000 --- a/.project +++ /dev/null @@ -1,27 +0,0 @@ - - - ascgit017.CommonAPI-Tools - - - - - - org.eclipse.cdt.managedbuilder.core.genmakebuilder - clean,full,incremental, - - - - - org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder - full,incremental, - - - - - - org.eclipse.cdt.core.cnature - org.eclipse.cdt.core.ccnature - org.eclipse.cdt.managedbuilder.core.managedBuildNature - org.eclipse.cdt.managedbuilder.core.ScannerConfigNature - - diff --git a/CHANGES b/CHANGES index bce6bb5..1556f45 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,9 @@ Changes ======= +v3.1.12.1 +- Fixed data race in generated StubDefault when using attributes +- Fix extended unions with custom data types + v3.1.12 - Fix compiler warnings in generated code - Test adaptions diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend index f050a54..01f4417 100644 --- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend +++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend @@ -80,6 +80,10 @@ class FInterfaceStubGenerator { #include <«requiredHeaderFile»> «ENDFOR» + «IF !fInterface.attributes.empty» + #include + «ENDIF» + #include #undef COMMONAPI_INTERNAL_COMPILATION @@ -134,6 +138,18 @@ class FInterfaceStubGenerator { «ENDFOR» virtual void deactivateManagedInstances() = 0; + + void lockAttributes() { + «IF !fInterface.attributes.empty» + attributesMutex_.lock(); + «ENDIF» + } + + void unlockAttributes() { + «IF !fInterface.attributes.empty» + attributesMutex_.unlock(); + «ENDIF» + } protected: /** * Defines properties for storing the ClientIds of clients / proxies that have @@ -144,6 +160,10 @@ class FInterfaceStubGenerator { std::shared_ptr «broadcast.stubAdapterClassSubscriberListPropertyName»; «ENDIF» «ENDFOR» + + «IF !fInterface.attributes.empty» + std::mutex attributesMutex_; + «ENDIF» }; /** @@ -537,8 +557,18 @@ class FInterfaceStubGenerator { if (!«attribute.stubDefaultClassValidateMethodName»(_value)) return false; - const bool valueChanged = («attribute.stubDefaultClassVariableName» != _value); - «attribute.stubDefaultClassVariableName» = std::move(_value); + bool valueChanged; + std::shared_ptr<«fInterface.stubAdapterClassName»> stubAdapter = CommonAPI::Stub<«fInterface.stubAdapterClassName», «fInterface.stubRemoteEventClassName»>::stubAdapter_.lock(); + if(stubAdapter) { + stubAdapter->lockAttributes(); + valueChanged = («attribute.stubDefaultClassVariableName» != _value); + «attribute.stubDefaultClassVariableName» = std::move(_value); + stubAdapter->unlockAttributes(); + } else { + valueChanged = («attribute.stubDefaultClassVariableName» != _value); + «attribute.stubDefaultClassVariableName» = std::move(_value); + } + return valueChanged; } diff --git a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCommonAreaGenerator.xtend b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCommonAreaGenerator.xtend index 782b607..9abb480 100644 --- a/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCommonAreaGenerator.xtend +++ b/org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCommonAreaGenerator.xtend @@ -85,7 +85,7 @@ class FTypeCommonAreaGenerator { var item = iter.next var lName = ""; if (item.type.derived != null) { - lName = parent.model.namespaceAsList.join("::") + "::" + item.getClassNamespaceWithName(item.elementName, parent, parent.name) + lName = parent.versionPrefix + parent.model.namespaceAsList.join("::") + "::" + item.getTypeName(fUnion, true) } else { lName = item.getTypeName(fUnion, false) }