Install package dependency:
```sh
-sudo apt-get install gbs cmake libboost-all-dev libgtest-dev
+sudo apt-get install gbs cmake libboost-all-dev libgtest-dev libsystemd-dev
```
Compile gtest shared libraries:
PresenceHook presence_hook;
std::mutex owned_mutex;
std::shared_ptr<OCResource> notificationResource;
+ std::mutex notificationMtx;
};
IoTivity* IoTivity::instance = nullptr;
guardUnauthorized();
std::mutex mtx;
- std::mutex curResourceLock;
std::unique_lock<std::mutex> lock(mtx);
std::condition_variable condVar;
auto foundCb = [&](std::shared_ptr<OCResource> resource)
{
- lock_guard<std::mutex> lock(curResourceLock);
+ lock_guard<std::mutex> curResourceLock(params->notificationMtx);
if(!params->notificationResource)
{
ADD_FAILURE() << e.what();
}
- cout << "iot->unsubscribeNotifications();" << endl << flush;
iot->unsubscribeNotifications();
userDataCheck.notificationCV.wait_for(notificationLock, std::chrono::seconds(10));
ASSERT_EQ(EC_OK, NM_subscribeNotifications(ctx, notificationCb, userDataCheck));
notificationCV.wait_for(notificationLock, std::chrono::seconds(10));
- cout << "NM_unsubscribeNotifications(ctx);";
NM_unsubscribeNotifications(ctx);
notificationCV.wait_for(notificationLock, std::chrono::seconds(10));