* Replaced TaskScheduler with rak::priority_queue.

* Fixed an exception caused by initial hash check not properly
cleaning up HashQueue when canceling.


git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@606 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2005-12-08 21:19:53 +00:00
parent ba7d61b532
commit 12ef47da3c
30 changed files with 362 additions and 367 deletions
+2 -5
View File
@@ -60,10 +60,7 @@ DownloadFactory::DownloadFactory(const std::string& uri, Manager* m) :
m_session(false),
m_start(false) {
m_taskLoad.set_iterator(taskScheduler.end());
m_taskLoad.set_slot(rak::mem_fn(this, &DownloadFactory::receive_load));
m_taskCommit.set_iterator(taskScheduler.end());
m_taskCommit.set_slot(rak::mem_fn(this, &DownloadFactory::receive_commit));
}
@@ -77,12 +74,12 @@ DownloadFactory::~DownloadFactory() {
void
DownloadFactory::load() {
taskScheduler.insert(&m_taskLoad, cachedTime);
taskScheduler.push(m_taskLoad.prepare(cachedTime));
}
void
DownloadFactory::commit() {
taskScheduler.insert(&m_taskCommit, cachedTime);
taskScheduler.push(m_taskCommit.prepare(cachedTime));
}
void
+3 -3
View File
@@ -39,8 +39,8 @@
#include <iosfwd>
#include <sigc++/slot.h>
#include <rak/priority_queue_default.h>
#include "utils/task_item.h"
#include "http_queue.h"
namespace core {
@@ -87,8 +87,8 @@ private:
bool m_start;
Slot m_slotFinished;
utils::TaskItem m_taskLoad;
utils::TaskItem m_taskCommit;
rak::priority_item m_taskLoad;
rak::priority_item m_taskCommit;
};
}