reduce contention from ForumDialog

git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-cacheopt@4415 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
chrisparker126 2011-07-09 16:50:54 +00:00
parent 8c4a92bd5b
commit c1a9ed9e25
2 changed files with 10 additions and 1 deletions

View file

@ -134,6 +134,8 @@ ForumsDialog::ForumsDialog(QWidget *parent)
m_bProcessSettings = false;
subscribeFlags = 0;
mFillthreadCount = 0;
connect( ui.forumTreeWidget, SIGNAL( treeCustomContextMenuRequested( QPoint ) ), this, SLOT( forumListCustomPopupMenu( QPoint ) ) );
connect( ui.threadTreeWidget, SIGNAL( customContextMenuRequested( QPoint ) ), this, SLOT( threadListCustomPopupMenu( QPoint ) ) );
@ -465,7 +467,9 @@ void ForumsDialog::updateDisplay()
{
std::list<std::string> forumIds;
std::list<std::string>::iterator it;
if (!rsForums)
// suspend access to forum while thread is running
if (!rsForums || (mFillthreadCount != 0))
return;
if (rsForums->forumsChanged(forumIds))
@ -770,9 +774,11 @@ void ForumsDialog::fillThreadFinished()
thread = NULL;
}
mFillthreadCount -= 1;
#ifdef DEBUG_FORUMS
std::cerr << "ForumsDialog::fillThreadFinished done" << std::endl;
#endif
}
void ForumsDialog::fillThreadProgress(int current, int count)
@ -866,6 +872,8 @@ void ForumsDialog::insertThreads()
std::cerr << "ForumsDialog::insertThreads() Start fill thread" << std::endl;
#endif
mFillthreadCount +=1;
// start thread
fillThread->start();
}

View file

@ -136,6 +136,7 @@ private:
QFont m_ForumNameFont;
int lastViewType;
std::string lastForumID;
int mFillthreadCount;
ForumsFillThread *fillThread;