Run the transaction flusher in another thread.

* This fixes bug #8977.
This commit is contained in:
Axel Dörfler
2012-09-12 20:20:43 +02:00
parent 30aeebc716
commit 267b646396
2 changed files with 14 additions and 2 deletions
@@ -684,10 +684,20 @@ Journal::_TransactionWritten(int32 transactionID, int32 event, void* _logEntry)
/*static*/ void
Journal::_TransactionIdle(int32 transactionID, int32 event, void* _journal)
{
// The current transaction seems to be idle - flush it
// The current transaction seems to be idle - flush it. We can't do this
// in this thread, as flushing the log can produce new transaction events.
thread_id id = spawn_kernel_thread(&Journal::_FlushLog, "bfs log flusher",
B_NORMAL_PRIORITY, _journal);
if (id > 0)
resume_thread(id);
}
/*static*/ status_t
Journal::_FlushLog(void* _journal)
{
Journal* journal = (Journal*)_journal;
journal->_FlushLog(false, false);
return journal->_FlushLog(false, false);
}
@@ -60,7 +60,9 @@ private:
int32 event, void* _logEntry);
static void _TransactionIdle(int32 transactionID, int32 event,
void* _journal);
static status_t _FlushLog(void* _journal);
private:
Volume* fVolume;
recursive_lock fLock;
Transaction* fOwner;