From 366de8773c1364e871cb96c6401d9165db030e23 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 1 Sep 2019 13:51:34 +0200 Subject: [PATCH] db/update/Service: add `noexcept` --- src/db/update/Service.cxx | 10 +++++----- src/db/update/Service.hxx | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/db/update/Service.cxx b/src/db/update/Service.cxx index 70528186d..1f04330a1 100644 --- a/src/db/update/Service.cxx +++ b/src/db/update/Service.cxx @@ -41,7 +41,7 @@ UpdateService::UpdateService(const ConfigData &_config, EventLoop &_loop, SimpleDatabase &_db, CompositeStorage &_storage, - DatabaseListener &_listener) + DatabaseListener &_listener) noexcept :config(_config), defer(_loop, BIND_THIS_METHOD(RunDeferred)), db(_db), storage(_storage), @@ -50,7 +50,7 @@ UpdateService::UpdateService(const ConfigData &_config, { } -UpdateService::~UpdateService() +UpdateService::~UpdateService() noexcept { CancelAllAsync(); @@ -59,7 +59,7 @@ UpdateService::~UpdateService() } void -UpdateService::CancelAllAsync() +UpdateService::CancelAllAsync() noexcept { assert(GetEventLoop().IsInside()); @@ -70,7 +70,7 @@ UpdateService::CancelAllAsync() } void -UpdateService::CancelMount(const char *uri) +UpdateService::CancelMount(const char *uri) noexcept { /* determine which (mounted) database will be updated and what storage will be scanned */ @@ -160,7 +160,7 @@ UpdateService::StartThread(UpdateQueueItem &&i) } unsigned -UpdateService::GenerateId() +UpdateService::GenerateId() noexcept { unsigned id = update_task_id + 1; if (id > update_task_id_max) diff --git a/src/db/update/Service.hxx b/src/db/update/Service.hxx index fb65abb6e..61fa1a68f 100644 --- a/src/db/update/Service.hxx +++ b/src/db/update/Service.hxx @@ -64,9 +64,9 @@ public: UpdateService(const ConfigData &_config, EventLoop &_loop, SimpleDatabase &_db, CompositeStorage &_storage, - DatabaseListener &_listener); + DatabaseListener &_listener) noexcept; - ~UpdateService(); + ~UpdateService() noexcept; auto &GetEventLoop() const noexcept { return defer.GetEventLoop(); @@ -76,7 +76,7 @@ public: * Returns a non-zero job id when we are currently updating * the database. */ - unsigned GetId() const { + unsigned GetId() const noexcept { return next.id; } @@ -96,14 +96,14 @@ public: * Clear the queue and cancel the current update. Does not * wait for the thread to exit. */ - void CancelAllAsync(); + void CancelAllAsync() noexcept; /** * Cancel all updates for the given mount point. If an update * is already running for it, the method will wait for * cancellation to complete. */ - void CancelMount(const char *uri); + void CancelMount(const char *uri) noexcept; private: /* DeferEvent callback */ @@ -114,7 +114,7 @@ private: void StartThread(UpdateQueueItem &&i); - unsigned GenerateId(); + unsigned GenerateId() noexcept; }; #endif