File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed
org.genivi.commonapi.core/src/org/genivi/commonapi/core/generator Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change 11Changes
22=======
3+
4+ v3.1.12.3
5+ - Prevent crash due to concurrent attribute access from stub itself
6+ and a remote client.
7+
38v3.1.12.2
49- Reworked attribute locking in StubAdapter to prevent deadlock
510
Original file line number Diff line number Diff line change @@ -550,13 +550,27 @@ class FInterfaceStubGenerator {
550550 }
551551
552552 void «fInterface. stubDefaultClassName»:: «attribute. stubDefaultClassSetMethodName»(«typeName» _value) {
553- «IF attribute. isObservable»const bool valueChanged = «ENDIF »«attribute. stubDefaultClassTrySetMethodName»(std:: move(_value));
554553 «IF attribute. isObservable»
555- if (valueChanged) {
556- «attribute. stubAdapterClassFireChangedMethodName»(«attribute. stubDefaultClassVariableName»);
554+ std:: shared_ptr< «fInterface. stubAdapterClassName»> stubAdapter = CommonAPI :: Stub<« fInterface. stubAdapterClassName»,
555+ «fInterface. stubRemoteEventClassName»> :: stubAdapter_. lock();
556+ if (stubAdapter) {
557+ stubAdapter- > «attribute. stubClassLockMethodName»(true );
558+ const bool valueChanged = («attribute. stubDefaultClassVariableName» != _value);
559+ if (valueChanged) {
560+ «attribute. stubDefaultClassVariableName» = std:: move(_value);
561+ «attribute. stubAdapterClassFireChangedMethodName»(«attribute. stubDefaultClassVariableName»);
562+ }
563+ stubAdapter- > «attribute. stubClassLockMethodName»(false );
564+ } else {
565+ const bool valueChanged = «attribute. stubDefaultClassTrySetMethodName»(std:: move(_value));
566+ if (valueChanged) {
567+ «attribute. stubAdapterClassFireChangedMethodName»(«attribute. stubDefaultClassVariableName»);
568+ }
557569 }
570+ «ELSE »
571+ «attribute. stubDefaultClassTrySetMethodName»(std:: move(_value));
558572 «ENDIF »
559- }
573+ }
560574
561575 bool «fInterface. stubDefaultClassName»:: «attribute. stubDefaultClassTrySetMethodName»(«typeName» _value) {
562576 if (! «attribute. stubDefaultClassValidateMethodName»(_value))
You can’t perform that action at this time.
0 commit comments