mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-27 00:19:25 -05:00
attempt to fix thread race between rsEvents and TokenQueue
This commit is contained in:
parent
b6ca07aaa3
commit
e402630095
@ -1296,7 +1296,9 @@ bool p3GxsTunnelService::locked_sendEncryptedTunnelData(RsGxsTunnelItem *item)
|
|||||||
}
|
}
|
||||||
if(it->second.status != RS_GXS_TUNNEL_STATUS_CAN_TALK)
|
if(it->second.status != RS_GXS_TUNNEL_STATUS_CAN_TALK)
|
||||||
{
|
{
|
||||||
|
#ifdef DEBUG_GXS_TUNNEL
|
||||||
std::cerr << "(EE) Cannot talk to tunnel id " << tunnel_id << ". Tunnel status is: " << it->second.status << std::endl;
|
std::cerr << "(EE) Cannot talk to tunnel id " << tunnel_id << ". Tunnel status is: " << it->second.status << std::endl;
|
||||||
|
#endif
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -404,11 +404,10 @@ int p3MsgService::checkOutgoingMessages()
|
|||||||
mit->second->msgFlags |= RS_MSG_FLAGS_ROUTED;
|
mit->second->msgFlags |= RS_MSG_FLAGS_ROUTED;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#ifdef DEBUG_DISTANT_MSG
|
||||||
else
|
else
|
||||||
{
|
Dbg3() << __PRETTY_FUNCTION__ << " Delaying until available..." << std::endl;
|
||||||
Dbg3() << __PRETTY_FUNCTION__ << " Delaying until available..."
|
#endif
|
||||||
<< std::endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* clean up */
|
/* clean up */
|
||||||
|
@ -1103,6 +1103,7 @@ void NewsFeed::addFeedItem(FeedItem *item)
|
|||||||
{
|
{
|
||||||
static const int MAX_FEEDITEM_COUNT = 500 ;
|
static const int MAX_FEEDITEM_COUNT = 500 ;
|
||||||
|
|
||||||
|
std::cerr << "Adding feed item thread " << pthread_self() << std::endl;
|
||||||
item->setAttribute(Qt::WA_DeleteOnClose, true);
|
item->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||||
|
|
||||||
// costly, but not really a problem here
|
// costly, but not really a problem here
|
||||||
@ -1125,6 +1126,7 @@ void NewsFeed::addFeedItemIfUnique(FeedItem *item, bool replace)
|
|||||||
{
|
{
|
||||||
FeedItem *feedItem = ui->feedWidget->findFeedItem(item->uniqueIdentifier());
|
FeedItem *feedItem = ui->feedWidget->findFeedItem(item->uniqueIdentifier());
|
||||||
|
|
||||||
|
std::cerr << "Adding feed item thread " << pthread_self() << std::endl;
|
||||||
if (feedItem)
|
if (feedItem)
|
||||||
{
|
{
|
||||||
if (!replace)
|
if (!replace)
|
||||||
@ -1143,6 +1145,7 @@ void NewsFeed::remUniqueFeedItem(FeedItem *item)
|
|||||||
{
|
{
|
||||||
FeedItem *feedItem = ui->feedWidget->findFeedItem(item->uniqueIdentifier());
|
FeedItem *feedItem = ui->feedWidget->findFeedItem(item->uniqueIdentifier());
|
||||||
|
|
||||||
|
std::cerr << "Adding feed item thread " << pthread_self() << std::endl;
|
||||||
if (feedItem)
|
if (feedItem)
|
||||||
{
|
{
|
||||||
delete item;
|
delete item;
|
||||||
|
@ -34,7 +34,7 @@ TokenQueue::TokenQueue(RsTokenService *service, TokenResponse *resp)
|
|||||||
{
|
{
|
||||||
mTrigger = new RsProtectedTimer(this);
|
mTrigger = new RsProtectedTimer(this);
|
||||||
mTrigger->setSingleShot(true);
|
mTrigger->setSingleShot(true);
|
||||||
connect(mTrigger, SIGNAL(timeout()), this, SLOT(pollRequests()));
|
connect(mTrigger, SIGNAL(timeout()), this, SLOT(pollRequests()),Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, std::list<RsGxsGroupId>& ids, uint32_t usertype)
|
bool TokenQueue::requestGroupInfo(uint32_t &token, uint32_t anstype, const RsTokReqOptions &opts, std::list<RsGxsGroupId>& ids, uint32_t usertype)
|
||||||
|
Loading…
Reference in New Issue
Block a user