1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-12-18 13:54:11 +03:00

Add sync forceFlush and modified unit_test to be in working state again.

This commit is contained in:
Ben Thompson
2019-05-28 15:18:19 -05:00
parent b9d7a2e4c4
commit 9351962942
4 changed files with 33 additions and 3 deletions

16
src/Synchronizer.cpp Normal file → Executable file
View File

@@ -205,7 +205,14 @@ void Synchronizer::periodicSync()
while (!die)
{
lock.unlock();
boost::this_thread::sleep_for(syncInterval);
try
{
boost::this_thread::sleep_for(syncInterval);
}
catch (const boost::thread_interrupted)
{
//logger->log(LOG_DEBUG,"Synchronizer Force Flush.");
}
lock.lock();
//cout << "Sync'ing " << pendingOps.size() << " objects" << " queue size is " <<
// threadPool.currentQueueSize() << endl;
@@ -214,6 +221,13 @@ void Synchronizer::periodicSync()
}
}
void Synchronizer::forceFlush()
{
boost::unique_lock<boost::mutex> lock(mutex);
syncThread.interrupt();
lock.unlock();
}
void Synchronizer::makeJob(const string &key)
{
objNames.push_front(key);