From: Rami Jung Date: Wed, 12 Aug 2015 09:55:56 +0000 (+0900) Subject: [Resource Encapsulation] removing "boost/atomic.hpp" from ResourcePressence.h X-Git-Tag: 1.2.0+RC1~1223 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8e24e16e2885f5d59618df1d32c7bc33cc3242c4;p=platform%2Fupstream%2Fiotivity.git [Resource Encapsulation] removing "boost/atomic.hpp" from ResourcePressence.h That was removed because Tizen 2.3 uses boost 1.51 which doesn't have "boost/atomic.hpp" Instead of boost::atomic_long, std::atomic_long has been applied and related module has been changed - (receivedTime.load(boost::memory_order_consume) is changed to "receivedTime" at ResourcePresence::timeOutCB from ResourcePressence.cpp Change-Id: I45758e639c0991e7b4f9b9a20816d9e970b2c984 Signed-off-by: Rami Jung Reviewed-on: https://gerrit.iotivity.org/gerrit/2182 Reviewed-by: JungHo Kim Tested-by: jenkins-iotivity Reviewed-by: Uze Choi --- diff --git a/service/resource-encapsulation/src/resourceBroker/include/ResourcePresence.h b/service/resource-encapsulation/src/resourceBroker/include/ResourcePresence.h index acb54b6..220bc77 100644 --- a/service/resource-encapsulation/src/resourceBroker/include/ResourcePresence.h +++ b/service/resource-encapsulation/src/resourceBroker/include/ResourcePresence.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include @@ -64,7 +64,7 @@ namespace OIC BROKER_MODE mode; bool isWithinTime; - boost::atomic_long receivedTime; + std::atomic_long receivedTime; std::mutex cbMutex; unsigned int timeoutHandle; diff --git a/service/resource-encapsulation/src/resourceBroker/src/ResourcePresence.cpp b/service/resource-encapsulation/src/resourceBroker/src/ResourcePresence.cpp index e6ab0ef..bb80de3 100644 --- a/service/resource-encapsulation/src/resourceBroker/src/ResourcePresence.cpp +++ b/service/resource-encapsulation/src/resourceBroker/src/ResourcePresence.cpp @@ -218,8 +218,7 @@ namespace OIC time(¤tTime); currentTime += 0L; - if((receivedTime.load(boost::memory_order_consume) == 0) || - ((receivedTime + BROKER_SAFE_SECOND) > currentTime )) + if((receivedTime == 0) || ((receivedTime + BROKER_SAFE_SECOND) > currentTime )) { this->isWithinTime = true; return;