mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-13 08:29:32 -05:00
patched BroadcastDiscivery and GxsNetTunnel so that they respond faster to shutdown
This commit is contained in:
parent
5fc3108533
commit
0757b161ba
@ -766,7 +766,12 @@ void RsGxsNetTunnelService::threadTick()
|
||||
}
|
||||
#endif
|
||||
|
||||
rstime::rs_usleep(1*1000*1000) ; // 1 sec
|
||||
for(uint32_t i=0;i<2;++i)
|
||||
{
|
||||
if(shouldStop())
|
||||
return;
|
||||
rstime::rs_usleep(500*1000) ; // 1 sec
|
||||
}
|
||||
}
|
||||
|
||||
const Bias20Bytes& RsGxsNetTunnelService::locked_randomBias()
|
||||
|
@ -141,8 +141,6 @@ void BroadcastDiscoveryService::updatePublishedData()
|
||||
|
||||
void BroadcastDiscoveryService::threadTick()
|
||||
{
|
||||
auto nextRunAt = std::chrono::system_clock::now() + std::chrono::seconds(5);
|
||||
|
||||
if( mUdcParameters.can_discover() &&
|
||||
!mRsPeers.isHiddenNode(mRsPeers.getOwnId()) )
|
||||
{
|
||||
@ -200,7 +198,13 @@ void BroadcastDiscoveryService::threadTick()
|
||||
if( mUdcParameters.can_be_discovered() &&
|
||||
!mRsPeers.isHiddenNode(mRsPeers.getOwnId()) ) updatePublishedData();
|
||||
|
||||
std::this_thread::sleep_until(nextRunAt);
|
||||
// This avoids waiting 5 secs when the thread should actually terminate (when RS closes).
|
||||
for(uint32_t i=0;i<10;++i)
|
||||
{
|
||||
if(shouldStop())
|
||||
return;
|
||||
rstime::rs_usleep(500*1000); // sleep for 0.5 sec.
|
||||
}
|
||||
}
|
||||
|
||||
RsBroadcastDiscoveryResult BroadcastDiscoveryService::createResult(
|
||||
|
@ -377,7 +377,7 @@ MainWindow::~MainWindow()
|
||||
delete sysTrayStatus;
|
||||
delete trayIcon;
|
||||
delete trayMenu;
|
||||
// delete notifyMenu;
|
||||
// delete notifyMenu; // already deleted by the deletion of trayMenu
|
||||
#ifdef MESSENGER_WINDOW
|
||||
MessengerWindow::releaseInstance();
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user