Skip to content

Commit

Permalink
FIX BUILD: noexpect(false) on a lot of destructors
Browse files Browse the repository at this point in the history
C++11 makes them noexcept by default and mordor sprinkles a lot of
ASSERTS.
  • Loading branch information
mtanski committed Feb 17, 2017
1 parent 4a4f14f commit cdd7cec
Show file tree
Hide file tree
Showing 17 changed files with 26 additions and 26 deletions.
4 changes: 2 additions & 2 deletions mordor/examples/netbench.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion mordor/fiber.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Fiber::Fiber(std::function<void ()> dg, size_t stacksize)
g_statMaxFibers.update(++g_cntFibers);
}

Fiber::~Fiber()
Fiber::~Fiber() noexcept(false)
{
--g_cntFibers;
if (!stack_ptr() ) {
Expand Down
2 changes: 1 addition & 1 deletion mordor/fiber.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class Fiber final : public std::enable_shared_from_this<Fiber>, private internal
/// are touched by the Fiber executing
/// @post state() == INIT
Fiber(std::function<void ()> 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
Expand Down
8 changes: 4 additions & 4 deletions mordor/fibersynchronization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

namespace Mordor {

FiberMutex::~FiberMutex()
FiberMutex::~FiberMutex() noexcept(false)
{
#ifndef NDEBUG
boost::mutex::scoped_lock scopeLock(m_mutex);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -126,7 +126,7 @@ FiberSemaphore::notify()
}
}

FiberCondition::~FiberCondition()
FiberCondition::~FiberCondition() noexcept(false)
{
#ifndef NDEBUG
boost::mutex::scoped_lock lock(m_mutex);
Expand Down Expand Up @@ -205,7 +205,7 @@ FiberCondition::broadcast()
}


FiberEvent::~FiberEvent()
FiberEvent::~FiberEvent() noexcept(false)
{
#ifndef NDEBUG
boost::mutex::scoped_lock lock(m_mutex);
Expand Down
8 changes: 4 additions & 4 deletions mordor/fibersynchronization.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mordor/http/broker.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ConnectionBroker
m_sslCtx(NULL),
m_timerManager(NULL)
{}
virtual ~ConnectionBroker() {}
virtual ~ConnectionBroker() noexcept(false) {}

virtual std::pair<std::shared_ptr<ClientConnection>, bool>
getConnection(const URI &uri, bool forceNewConnection = false) = 0;
Expand Down
2 changes: 1 addition & 1 deletion mordor/http/client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion mordor/http/client.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ClientRequest : public std::enable_shared_from_this<ClientRequest>
ClientRequest(const ClientRequest& rhs) = delete;

public:
~ClientRequest();
~ClientRequest() noexcept(false);

std::shared_ptr<ClientConnection> connection() { return m_conn; }
State requestState() const { return m_requestState; }
Expand Down
4 changes: 2 additions & 2 deletions mordor/iomanager_epoll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -218,7 +218,7 @@ IOManager::IOManager(size_t threads, bool useCaller, bool autoStart)
}
}

IOManager::~IOManager()
IOManager::~IOManager() noexcept(false)
{
stop();
close(m_epfd);
Expand Down
4 changes: 2 additions & 2 deletions mordor/iomanager_epoll.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class IOManager : public Scheduler, public TimerManager
struct AsyncState
{
AsyncState();
~AsyncState();
~AsyncState() noexcept(false);
AsyncState(const AsyncState& rhs) = delete;

struct EventContext
Expand Down Expand Up @@ -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();

Expand Down
2 changes: 1 addition & 1 deletion mordor/scheduler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion mordor/scheduler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion mordor/semaphore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ Semaphore::Semaphore(unsigned int count)
#endif
}

Semaphore::~Semaphore()
Semaphore::~Semaphore() noexcept(false)
{
#ifdef WINDOWS
MORDOR_VERIFY(CloseHandle(m_semaphore));
Expand Down
2 changes: 1 addition & 1 deletion mordor/semaphore.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Semaphore
public:
Semaphore(unsigned int count = 0);
Semaphore(const Semaphore& rhs) = delete;
~Semaphore();
~Semaphore() noexcept(false);

void wait();

Expand Down
2 changes: 1 addition & 1 deletion mordor/streams/stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; }
Expand Down
2 changes: 1 addition & 1 deletion mordor/timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ TimerManager::TimerManager()
m_previousTime(0ull)
{}

TimerManager::~TimerManager()
TimerManager::~TimerManager() noexcept(false)
{
#ifndef NDEBUG
boost::mutex::scoped_lock lock(m_mutex);
Expand Down
2 changes: 1 addition & 1 deletion mordor/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<void ()> dg, bool recurring = false);
Expand Down

0 comments on commit cdd7cec

Please sign in to comment.