db/update: cancel the update on shutdown

This commit is contained in:
Max Kellermann
2014-02-27 16:36:11 +01:00
parent 3be36643a1
commit 681e012fb5
7 changed files with 59 additions and 1 deletions

View File

@@ -64,6 +64,8 @@ public:
Storage &_storage,
DatabaseListener &_listener);
~UpdateService();
/**
* Returns a non-zero job id when we are currently updating
* the database.
@@ -82,6 +84,12 @@ public:
gcc_nonnull_all
unsigned Enqueue(const char *path, bool discard);
/**
* Clear the queue and cancel the current update. Does not
* wait for the thread to exit.
*/
void CancelAllAsync();
private:
/* virtual methods from class DeferredMonitor */
virtual void RunDeferred() override;