Skip to content

Commit 1bcfad8

Browse files
capicxx-core-tools 3.1.12.1
1 parent f5d29bd commit 1bcfad8

File tree

6 files changed

+37
-74
lines changed

6 files changed

+37
-74
lines changed

.gitattributes

Lines changed: 0 additions & 42 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.project

Lines changed: 0 additions & 27 deletions
This file was deleted.

CHANGES

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
Changes
22
=======
3+
v3.1.12.1
4+
- Fixed data race in generated StubDefault when using attributes
5+
- Fix extended unions with custom data types
6+
37
v3.1.12
48
- Fix compiler warnings in generated code
59
- Test adaptions

org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FInterfaceStubGenerator.xtend

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ class FInterfaceStubGenerator {
8080
#include <«requiredHeaderFile»>
8181
«ENDFOR»
8282

83+
«IF !fInterface.attributes.empty»
84+
#include <mutex>
85+
«ENDIF»
86+
8387
#include <CommonAPI/Stub.hpp>
8488

8589
#undef COMMONAPI_INTERNAL_COMPILATION
@@ -134,6 +138,18 @@ class FInterfaceStubGenerator {
134138
«ENDFOR»
135139

136140
virtual void deactivateManagedInstances() = 0;
141+
142+
void lockAttributes() {
143+
«IF !fInterface.attributes.empty»
144+
attributesMutex_.lock();
145+
«ENDIF»
146+
}
147+
148+
void unlockAttributes() {
149+
«IF !fInterface.attributes.empty»
150+
attributesMutex_.unlock();
151+
«ENDIF»
152+
}
137153
protected:
138154
/**
139155
* Defines properties for storing the ClientIds of clients / proxies that have
@@ -144,6 +160,10 @@ class FInterfaceStubGenerator {
144160
std::shared_ptr<CommonAPI::ClientIdList> «broadcast.stubAdapterClassSubscriberListPropertyName»;
145161
«ENDIF»
146162
«ENDFOR»
163+
164+
«IF !fInterface.attributes.empty»
165+
std::mutex attributesMutex_;
166+
«ENDIF»
147167
};
148168

149169
/**
@@ -537,8 +557,18 @@ class FInterfaceStubGenerator {
537557
if (!«attribute.stubDefaultClassValidateMethodName»(_value))
538558
return false;
539559

540-
const bool valueChanged = («attribute.stubDefaultClassVariableName» != _value);
541-
«attribute.stubDefaultClassVariableName» = std::move(_value);
560+
bool valueChanged;
561+
std::shared_ptr<«fInterface.stubAdapterClassName»> stubAdapter = CommonAPI::Stub<«fInterface.stubAdapterClassName», «fInterface.stubRemoteEventClassName»>::stubAdapter_.lock();
562+
if(stubAdapter) {
563+
stubAdapter->lockAttributes();
564+
valueChanged = («attribute.stubDefaultClassVariableName» != _value);
565+
«attribute.stubDefaultClassVariableName» = std::move(_value);
566+
stubAdapter->unlockAttributes();
567+
} else {
568+
valueChanged = («attribute.stubDefaultClassVariableName» != _value);
569+
«attribute.stubDefaultClassVariableName» = std::move(_value);
570+
}
571+
542572
return valueChanged;
543573
}
544574

org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator/FTypeCommonAreaGenerator.xtend

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class FTypeCommonAreaGenerator {
8585
var item = iter.next
8686
var lName = "";
8787
if (item.type.derived != null) {
88-
lName = parent.model.namespaceAsList.join("::") + "::" + item.getClassNamespaceWithName(item.elementName, parent, parent.name)
88+
lName = parent.versionPrefix + parent.model.namespaceAsList.join("::") + "::" + item.getTypeName(fUnion, true)
8989
} else {
9090
lName = item.getTypeName(fUnion, false)
9191
}

0 commit comments

Comments
 (0)