Skip to content

Commit

Permalink
capicxx-core-tools 3.1.12.1
Browse files Browse the repository at this point in the history
  • Loading branch information
juergengehring committed Jan 25, 2018
1 parent f5d29bd commit 1bcfad8
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 74 deletions.
42 changes: 0 additions & 42 deletions .gitattributes

This file was deleted.

2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

27 changes: 0 additions & 27 deletions .project

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@ class FInterfaceStubGenerator {
#include <«requiredHeaderFile»>
«ENDFOR»

«IF !fInterface.attributes.empty»
#include <mutex>
«ENDIF»

#include <CommonAPI/Stub.hpp>

#undef COMMONAPI_INTERNAL_COMPILATION
Expand Down Expand Up @@ -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
Expand All @@ -144,6 +160,10 @@ class FInterfaceStubGenerator {
std::shared_ptr<CommonAPI::ClientIdList> «broadcast.stubAdapterClassSubscriberListPropertyName»;
«ENDIF»
«ENDFOR»

«IF !fInterface.attributes.empty»
std::mutex attributesMutex_;
«ENDIF»
};

/**
Expand Down Expand Up @@ -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;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1bcfad8

Please sign in to comment.