Dispatch HashedObject background writes through our job queue.

This commit is contained in:
JoelKatz
2013-01-28 07:13:05 -08:00
parent e9d405302c
commit e48ef29f8c
3 changed files with 9 additions and 7 deletions

View File

@@ -51,7 +51,7 @@ bool HashedObjectStore::store(HashedObjectType type, uint32 index,
if (!mWritePending)
{
mWritePending = true;
boost::thread(boost::bind(&HashedObjectStore::bulkWrite, this)).detach();
theApp->getJobQueue().addJob(jtWRITE, boost::bind(&HashedObjectStore::bulkWrite, this));
}
}
// else
@@ -70,7 +70,6 @@ void HashedObjectStore::waitWrite()
void HashedObjectStore::bulkWrite()
{
LoadEvent::autoptr event(theApp->getJobQueue().getLoadEventAP(jtDISK));
while (1)
{
std::vector< boost::shared_ptr<HashedObject> > set;