Looks OK. /Bertil
-----Original Message----- From: Ingvar Bergström Sent: den 11 februari 2014 13:29 To: Bertil Engelholm Cc: opensaf-devel@lists.sourceforge.net Subject: [PATCH 1 of 1] smfd: No interference when error string is set after campaign parsing error [#763] osaf/services/saf/smfsv/smfd/SmfCampaign.cc | 21 +++++++++++++-------- 1 files changed, 13 insertions(+), 8 deletions(-) If the the campaign thread start fail shortly after it has been ordered. The campaign thread writing to error string can interfere with smfd thread clearing the same error string. The campaign thread is started at execute() and verify() admin operations. diff --git a/osaf/services/saf/smfsv/smfd/SmfCampaign.cc b/osaf/services/saf/smfsv/smfd/SmfCampaign.cc --- a/osaf/services/saf/smfsv/smfd/SmfCampaign.cc +++ b/osaf/services/saf/smfsv/smfd/SmfCampaign.cc @@ -335,6 +335,14 @@ SmfCampaign::adminOperation(const SaImmA } } + if (m_adminOpBusy == true) { + LOG_ER("Campaign temporary busy handling another admin op"); + return SA_AIS_ERR_BUSY; + } + /*Clear error string here to not interfere with the error string handling + in the campaign thread started below.*/ + setError(""); + if (SmfCampaignThread::instance() == NULL) { TRACE("Starting campaign thread %s", this->getDn().c_str()); if (SmfCampaignThread::start(this) != 0) { @@ -343,13 +351,7 @@ SmfCampaign::adminOperation(const SaImmA } } - if (m_adminOpBusy == true) { - LOG_ER("Campaign temporary busy handling another admin op"); - return SA_AIS_ERR_BUSY; - } - - SmfCampaignThread::instance()->campaign()->setError(""); - m_adminOpBusy = true; /* reset by campaign thread when admin op taken care of */ + m_adminOpBusy = true; /* reset by campaign thread when admin op taken care of */ TRACE("Sending execute event to thread"); CAMPAIGN_EVT *evt = new CAMPAIGN_EVT(); @@ -475,6 +477,10 @@ SmfCampaign::adminOperation(const SaImmA return SA_AIS_ERR_BUSY; } + /*Clear error string here to not interfere with the error string handling + in the campaign thread started below.*/ + setError(""); + if (SmfCampaignThread::instance() == NULL) { if (SmfCampaignThread::start(this) != 0) { return SA_AIS_ERR_CAMPAIGN_ERROR_DETECTED; @@ -484,7 +490,6 @@ SmfCampaign::adminOperation(const SaImmA return SA_AIS_ERR_BAD_OPERATION; } - SmfCampaignThread::instance()->campaign()->setError(""); m_adminOpBusy = true; /* reset by campaign thread when admin op taken care of */ CAMPAIGN_EVT *evt = new CAMPAIGN_EVT(); ------------------------------------------------------------------------------ Android apps run on BlackBerry 10 Introducing the new BlackBerry 10.2.1 Runtime for Android apps. Now with support for Jelly Bean, Bluetooth, Mapview and more. Get your Android app in front of a whole new audience. Start now. http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk _______________________________________________ Opensaf-devel mailing list Opensaf-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/opensaf-devel