diff --git a/mordor/examples/netbench.h b/mordor/examples/netbench.h index e183093a..9a79d520 100644 --- a/mordor/examples/netbench.h +++ b/mordor/examples/netbench.h @@ -6,7 +6,7 @@ class NetBenchServer { public: - virtual ~NetBenchServer() {} + virtual ~NetBenchServer() noexcept(false) {} // start the implementation of the server to be benchmarked virtual void run(std::string& host, @@ -21,7 +21,7 @@ class NetBenchServer class NetBenchClient { public: - virtual ~NetBenchClient () {} + virtual ~NetBenchClient () noexcept(false) {} // initialize the client to be benchmarked virtual void init(std::string& host, diff --git a/mordor/fiber.cpp b/mordor/fiber.cpp index beccb827..f453c409 100644 --- a/mordor/fiber.cpp +++ b/mordor/fiber.cpp @@ -103,7 +103,7 @@ Fiber::Fiber(std::function dg, size_t stacksize) g_statMaxFibers.update(++g_cntFibers); } -Fiber::~Fiber() +Fiber::~Fiber() noexcept(false) { --g_cntFibers; if (!stack_ptr() ) { diff --git a/mordor/fiber.h b/mordor/fiber.h index ef3c939d..9eb757b2 100644 --- a/mordor/fiber.h +++ b/mordor/fiber.h @@ -52,7 +52,7 @@ class Fiber final : public std::enable_shared_from_this, private internal /// are touched by the Fiber executing /// @post state() == INIT Fiber(std::function dg, size_t stacksize = 0); - ~Fiber(); + ~Fiber() noexcept(false); /// @brief Reset a Fiber to be used again, with a different initial function /// @param dg The new initial function diff --git a/mordor/fibersynchronization.cpp b/mordor/fibersynchronization.cpp index 2314ca05..bfd14764 100644 --- a/mordor/fibersynchronization.cpp +++ b/mordor/fibersynchronization.cpp @@ -8,7 +8,7 @@ namespace Mordor { -FiberMutex::~FiberMutex() +FiberMutex::~FiberMutex() noexcept(false) { #ifndef NDEBUG boost::mutex::scoped_lock scopeLock(m_mutex); @@ -80,7 +80,7 @@ FiberSemaphore::FiberSemaphore(size_t initialConcurrency) : m_concurrency(initialConcurrency) {} -FiberSemaphore::~FiberSemaphore() +FiberSemaphore::~FiberSemaphore() noexcept(false) { #ifndef NDEBUG boost::mutex::scoped_lock scopeLock(m_mutex); @@ -126,7 +126,7 @@ FiberSemaphore::notify() } } -FiberCondition::~FiberCondition() +FiberCondition::~FiberCondition() noexcept(false) { #ifndef NDEBUG boost::mutex::scoped_lock lock(m_mutex); @@ -205,7 +205,7 @@ FiberCondition::broadcast() } -FiberEvent::~FiberEvent() +FiberEvent::~FiberEvent() noexcept(false) { #ifndef NDEBUG boost::mutex::scoped_lock lock(m_mutex); diff --git a/mordor/fibersynchronization.h b/mordor/fibersynchronization.h index eccda6b8..d520aac6 100644 --- a/mordor/fibersynchronization.h +++ b/mordor/fibersynchronization.h @@ -87,7 +87,7 @@ struct FiberMutex public: FiberMutex() = default; - ~FiberMutex(); + ~FiberMutex() noexcept(false); /// @brief Locks the mutex /// Note that it is possible for this Fiber to switch threads after this @@ -128,7 +128,7 @@ struct FiberSemaphore { public: FiberSemaphore(size_t initialConcurrency = 0); - ~FiberSemaphore(); + ~FiberSemaphore() noexcept(false); /// @brief Waits for the semaphore /// Decreases the amount of concurrency. If concurrency is already at @@ -162,7 +162,7 @@ struct FiberCondition FiberCondition(FiberMutex &mutex) : m_fiberMutex(mutex) {} - ~FiberCondition(); + ~FiberCondition() noexcept(false); /// @brief Wait for the Condition to be signalled /// @details @@ -201,7 +201,7 @@ struct FiberEvent : m_signalled(false), m_autoReset(autoReset) {} - ~FiberEvent(); + ~FiberEvent() noexcept(false); /// @brief Wait for the Event to become set /// @pre Scheduler::getThis() != NULL diff --git a/mordor/http/broker.h b/mordor/http/broker.h index 65559631..6bfd71f6 100644 --- a/mordor/http/broker.h +++ b/mordor/http/broker.h @@ -115,7 +115,7 @@ class ConnectionBroker m_sslCtx(NULL), m_timerManager(NULL) {} - virtual ~ConnectionBroker() {} + virtual ~ConnectionBroker() noexcept(false) {} virtual std::pair, bool> getConnection(const URI &uri, bool forceNewConnection = false) = 0; diff --git a/mordor/http/client.cpp b/mordor/http/client.cpp index 22135128..429586d6 100644 --- a/mordor/http/client.cpp +++ b/mordor/http/client.cpp @@ -499,7 +499,7 @@ ClientRequest::ClientRequest(ClientConnection::ptr conn, const Request &request) MORDOR_ASSERT(m_conn); } -ClientRequest::~ClientRequest() +ClientRequest::~ClientRequest() noexcept(false) { cancel(true); #ifndef NDEBUG diff --git a/mordor/http/client.h b/mordor/http/client.h index da447d9e..586234ed 100644 --- a/mordor/http/client.h +++ b/mordor/http/client.h @@ -58,7 +58,7 @@ class ClientRequest : public std::enable_shared_from_this ClientRequest(const ClientRequest& rhs) = delete; public: - ~ClientRequest(); + ~ClientRequest() noexcept(false); std::shared_ptr connection() { return m_conn; } State requestState() const { return m_requestState; } diff --git a/mordor/iomanager_epoll.cpp b/mordor/iomanager_epoll.cpp index 5e0dbebf..948e97fa 100644 --- a/mordor/iomanager_epoll.cpp +++ b/mordor/iomanager_epoll.cpp @@ -99,7 +99,7 @@ IOManager::AsyncState::AsyncState() m_events(NONE) {} -IOManager::AsyncState::~AsyncState() +IOManager::AsyncState::~AsyncState() noexcept(false) { boost::mutex::scoped_lock lock(m_mutex); MORDOR_ASSERT(!m_events); @@ -218,7 +218,7 @@ IOManager::IOManager(size_t threads, bool useCaller, bool autoStart) } } -IOManager::~IOManager() +IOManager::~IOManager() noexcept(false) { stop(); close(m_epfd); diff --git a/mordor/iomanager_epoll.h b/mordor/iomanager_epoll.h index 93bcdc71..a616346c 100644 --- a/mordor/iomanager_epoll.h +++ b/mordor/iomanager_epoll.h @@ -30,7 +30,7 @@ class IOManager : public Scheduler, public TimerManager struct AsyncState { AsyncState(); - ~AsyncState(); + ~AsyncState() noexcept(false); AsyncState(const AsyncState& rhs) = delete; struct EventContext @@ -59,7 +59,7 @@ class IOManager : public Scheduler, public TimerManager /// @note @p autoStart provides a more friendly behavior for derived class /// that inherits from IOManager IOManager(size_t threads = 1, bool useCaller = true, bool autoStart = true); - ~IOManager(); + ~IOManager() noexcept(false); bool stopping(); diff --git a/mordor/scheduler.cpp b/mordor/scheduler.cpp index f892a59b..81d3bb56 100644 --- a/mordor/scheduler.cpp +++ b/mordor/scheduler.cpp @@ -34,7 +34,7 @@ Scheduler::Scheduler(size_t threads, bool useCaller, size_t batchSize) m_threadCount = threads; } -Scheduler::~Scheduler() +Scheduler::~Scheduler() noexcept(false) { MORDOR_ASSERT(m_stopping); if (getThis() == this) { diff --git a/mordor/scheduler.h b/mordor/scheduler.h index e125f3fb..2532edf4 100644 --- a/mordor/scheduler.h +++ b/mordor/scheduler.h @@ -43,7 +43,7 @@ class Scheduler /// @pre if (useCaller == true) Scheduler::getThis() == NULL Scheduler(size_t threads = 1, bool useCaller = true, size_t batchSize = 1); /// Destroys the scheduler, implicitly calling stop() - virtual ~Scheduler(); + virtual ~Scheduler() noexcept(false); /// @return The Scheduler controlling the currently executing thread static Scheduler* getThis(); diff --git a/mordor/semaphore.cpp b/mordor/semaphore.cpp index cfbeb49c..51c702cc 100644 --- a/mordor/semaphore.cpp +++ b/mordor/semaphore.cpp @@ -50,7 +50,7 @@ Semaphore::Semaphore(unsigned int count) #endif } -Semaphore::~Semaphore() +Semaphore::~Semaphore() noexcept(false) { #ifdef WINDOWS MORDOR_VERIFY(CloseHandle(m_semaphore)); diff --git a/mordor/semaphore.h b/mordor/semaphore.h index 5d525e45..e3057733 100644 --- a/mordor/semaphore.h +++ b/mordor/semaphore.h @@ -21,7 +21,7 @@ class Semaphore public: Semaphore(unsigned int count = 0); Semaphore(const Semaphore& rhs) = delete; - ~Semaphore(); + ~Semaphore() noexcept(false); void wait(); diff --git a/mordor/streams/stream.h b/mordor/streams/stream.h index c95179f5..ef47c194 100644 --- a/mordor/streams/stream.h +++ b/mordor/streams/stream.h @@ -59,7 +59,7 @@ class Stream /// Cleans up the underlying implementation, possibly by ungracefully /// closing it. - virtual ~Stream() {} + virtual ~Stream() noexcept(false) {} /// @return If it is valid to call close() with READ or WRITE virtual bool supportsHalfClose() { return false; } diff --git a/mordor/timer.cpp b/mordor/timer.cpp index b4608a00..20f77e02 100644 --- a/mordor/timer.cpp +++ b/mordor/timer.cpp @@ -169,7 +169,7 @@ TimerManager::TimerManager() m_previousTime(0ull) {} -TimerManager::~TimerManager() +TimerManager::~TimerManager() noexcept(false) { #ifndef NDEBUG boost::mutex::scoped_lock lock(m_mutex); diff --git a/mordor/timer.h b/mordor/timer.h index 3a671f1d..debb0c01 100644 --- a/mordor/timer.h +++ b/mordor/timer.h @@ -62,7 +62,7 @@ class TimerManager public: TimerManager(); TimerManager(const TimerManager& rhs) = delete; - virtual ~TimerManager(); + virtual ~TimerManager() noexcept(false); virtual Timer::ptr registerTimer(unsigned long long us, std::function dg, bool recurring = false);