Skip to content

Commit

Permalink
Small changes
Browse files Browse the repository at this point in the history
  • Loading branch information
hfedcba committed May 13, 2018
1 parent 8b89297 commit 72aeb5e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/HomeMaticCentral.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4017,11 +4017,14 @@ PVariable HomeMaticCentral::addDevice(BaseLib::PRpcClientInfo clientInfo, std::s
while(!peer && i < 3)
{
packet->setMessageCounter(getMessageCounter());
_sendPacketThreadMutex.lock();
_bl->threadManager.join(_sendPacketThread);
_bl->threadManager.start(_sendPacketThread, false, &HomeMaticCentral::sendPacket, this, GD::defaultPhysicalInterface, packet, false);
_sendPacketThreadMutex.unlock();
std::this_thread::sleep_for(std::chrono::milliseconds(3000));

{
std::lock_guard<std::mutex> sendPacketThreadGuard(_sendPacketThreadMutex);
_bl->threadManager.join(_sendPacketThread);
_bl->threadManager.start(_sendPacketThread, false, &HomeMaticCentral::sendPacket, this, GD::defaultPhysicalInterface, packet, false);
}

std::this_thread::sleep_for(std::chrono::milliseconds(3000));
peer = getPeer(serialNumber);
i++;
}
Expand Down

0 comments on commit 72aeb5e

Please sign in to comment.