=== modified file 'debian/control'
--- debian/control	2015-01-08 03:16:37 +0000
+++ debian/control	2015-01-12 11:51:58 +0000
@@ -73,7 +73,7 @@
  .
  Contains the shared library needed by server applications for Mir.
 
-Package: libmirplatform5
+Package: libmirplatform6
 Section: libs
 Architecture: i386 amd64 armhf arm64
 Multi-Arch: same
@@ -109,7 +109,7 @@
 Architecture: i386 amd64 armhf arm64
 Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
-Depends: libmirplatform5 (= ${binary:Version}), 
+Depends: libmirplatform6 (= ${binary:Version}),
          libmircommon-dev,
          libboost-program-options-dev,
          ${misc:Depends},
@@ -294,7 +294,7 @@
  Contains the shared libraries required for the Mir clients to interact with
  the underlying hardware platform using the Android drivers.
 
-Package: libmirplatform5driver-mesa
+Package: libmirplatform6driver-mesa
 Section: libs
 Architecture: i386 amd64 armhf arm64
 Multi-Arch: same
@@ -308,7 +308,7 @@
  Contains the shared libraries required for the Mir server to interact with
  the hardware platform using the Mesa drivers.
 
-Package: libmirplatform5driver-android
+Package: libmirplatform6driver-android
 Section: libs
 Architecture: i386 amd64 armhf
 Multi-Arch: same

=== renamed file 'debian/libmirplatform5.install' => 'debian/libmirplatform6.install'
--- debian/libmirplatform5.install	2014-12-08 04:03:47 +0000
+++ debian/libmirplatform6.install	2015-01-12 11:51:58 +0000
@@ -1,1 +1,1 @@
-usr/lib/*/libmirplatform.so.5
+usr/lib/*/libmirplatform.so.6

=== renamed file 'debian/libmirplatform5driver-android.install' => 'debian/libmirplatform6driver-android.install'
=== renamed file 'debian/libmirplatform5driver-mesa.install' => 'debian/libmirplatform6driver-mesa.install'
=== modified file 'debian/rules'
--- debian/rules	2015-01-07 02:30:43 +0000
+++ debian/rules	2015-01-12 11:51:58 +0000
@@ -13,7 +13,7 @@
 export CC=$(DEB_HOST_GNU_TYPE)-gcc-4.9
 export CXX=$(DEB_HOST_GNU_TYPE)-g++-4.9
 
-export PLATFORM_DRIVER = platform5driver
+export PLATFORM_DRIVER = platform6driver
 
 %:
 	dh $@ --parallel --fail-missing

=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt	2014-12-28 12:42:26 +0000
+++ src/CMakeLists.txt	2015-01-12 11:51:58 +0000
@@ -1,6 +1,6 @@
 # We need MIRPLATFORM_ABI and MIR_PLATFORM_DRIVER_BINARY in both libmirplatform 
 # and the platform implementations.
-set(MIRPLATFORM_ABI 5)
+set(MIRPLATFORM_ABI 6)
 
 set(PLATFORM_DRIVER platform${MIRPLATFORM_ABI}driver)
 set(MIR_PLATFORM_DRIVER mir${PLATFORM_DRIVER})

=== modified file 'src/include/platform/mir/options/configuration.h'
--- src/include/platform/mir/options/configuration.h	2014-12-15 06:24:03 +0000
+++ src/include/platform/mir/options/configuration.h	2015-01-12 11:51:58 +0000
@@ -44,7 +44,6 @@
 extern char const* const touchspots_opt;
 extern char const* const fatal_abort_opt;
 extern char const* const debug_opt;
-extern char const* const use_asio_main_loop_opt;
 
 extern char const* const name_opt;
 extern char const* const offscreen_opt;

=== removed file 'src/include/server/mir/asio_main_loop.h'
--- src/include/server/mir/asio_main_loop.h	2014-12-08 04:03:47 +0000
+++ src/include/server/mir/asio_main_loop.h	1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
-/*
- * Copyright © 2013 Canonical Ltd.
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
- */
-
-#ifndef MIR_ASIO_MAIN_LOOP_H_
-#define MIR_ASIO_MAIN_LOOP_H_
-
-#include "mir/main_loop.h"
-
-#include <boost/asio.hpp>
-#include <boost/optional.hpp>
-#include <memory>
-#include <vector>
-#include <thread>
-#include <mutex>
-#include <utility>
-#include <deque>
-#include <set>
-
-namespace mir
-{
-
-namespace time
-{
-class Clock;
-}
-
-class AsioMainLoop : public MainLoop
-{
-public:
-    explicit AsioMainLoop(std::shared_ptr<time::Clock> const& clock);
-    ~AsioMainLoop() noexcept(true);
-
-    void run() override;
-    void stop() override;
-
-    void register_signal_handler(
-        std::initializer_list<int> signals,
-        std::function<void(int)> const& handler) override;
-
-    void register_fd_handler(
-        std::initializer_list<int> fd,
-        void const* owner,
-        std::function<void(int)> const& handler) override;
-
-    void unregister_fd_handler(void const* owner) override;
-
-    std::unique_ptr<time::Alarm> notify_in(std::chrono::milliseconds delay,
-                                           std::function<void()> callback) override;
-    std::unique_ptr<time::Alarm> notify_at(mir::time::Timestamp time_point,
-                                           std::function<void()> callback) override;
-    std::unique_ptr<time::Alarm> create_alarm(std::function<void()> callback) override;
-
-    void enqueue(void const* owner, ServerAction const& action) override;
-    void pause_processing_for(void const* owner) override;
-    void resume_processing_for(void const* owner) override;
-
-private:
-    class SignalHandler;
-    class FDHandler;
-    bool should_process(void const*);
-    void process_server_actions();
-
-    boost::asio::io_service io;
-    boost::asio::io_service::work work;
-    boost::optional<std::thread::id> main_loop_thread;
-    std::vector<std::unique_ptr<SignalHandler>> signal_handlers;
-    std::vector<std::shared_ptr<FDHandler>> fd_handlers;
-    std::mutex fd_handlers_mutex;
-    std::mutex server_actions_mutex;
-    std::deque<std::pair<void const*,ServerAction>> server_actions;
-    std::set<void const*> do_not_process;
-    std::shared_ptr<time::Clock> const clock;
-};
-
-}
-
-#endif /* MIR_ASIO_MAIN_LOOP_H */

=== modified file 'src/platform/options/default_configuration.cpp'
--- src/platform/options/default_configuration.cpp	2014-12-08 04:03:47 +0000
+++ src/platform/options/default_configuration.cpp	2015-01-12 11:51:58 +0000
@@ -46,7 +46,6 @@
 char const* const mo::touchspots_opt               = "enable-touchspots";
 char const* const mo::fatal_abort_opt             = "on-fatal-error-abort";
 char const* const mo::debug_opt                   = "debug";
-char const* const mo::use_asio_main_loop_opt      = "use-asio-main-loop";
 
 char const* const mo::off_opt_value = "off";
 char const* const mo::log_opt_value = "log";
@@ -146,8 +145,7 @@
         (fatal_abort_opt, "On \"fatal error\" conditions [e.g. drivers behaving "
             "in unexpected ways] abort (to get a core dump)")
         (debug_opt, "Enable extra development debugging. "
-            "This is only interesting for people doing Mir server or client development.")
-        (use_asio_main_loop_opt, "Use the ASIO main loop implementation");
+            "This is only interesting for people doing Mir server or client development.");
 
         add_platform_options();
 }

=== modified file 'src/platform/symbols.map'
--- src/platform/symbols.map	2014-12-20 00:08:29 +0000
+++ src/platform/symbols.map	2015-01-12 11:51:58 +0000
@@ -1,4 +1,4 @@
-MIRPLATFORM_5 {
+MIRPLATFORM_6 {
  global:
   extern "C++" {
 # The following symbols come from running a script over the generated docs. Vis:
@@ -156,7 +156,6 @@
     mir::options::server_socket_opt*;
     mir::options::session_mediator_report_opt*;
     mir::options::touchspots_opt*;
-    mir::options::use_asio_main_loop_opt*;
     non-virtual?thunk?to?mir::graphics::Cursor::?Cursor*;
     non-virtual?thunk?to?mir::graphics::CursorImage::?CursorImage*;
     non-virtual?thunk?to?mir::graphics::DisplayConfigurationPolicy::?DisplayConfigurationPolicy*;

=== modified file 'src/server/CMakeLists.txt'
--- src/server/CMakeLists.txt	2014-12-19 02:31:34 +0000
+++ src/server/CMakeLists.txt	2015-01-12 11:51:58 +0000
@@ -40,7 +40,6 @@
   report_exception.cpp
   display_server.cpp
   default_server_configuration.cpp
-  asio_main_loop.cpp
   glib_main_loop.cpp
   glib_main_loop_sources.cpp
   default_emergency_cleanup.cpp

=== removed file 'src/server/asio_main_loop.cpp'
--- src/server/asio_main_loop.cpp	2014-12-08 04:03:47 +0000
+++ src/server/asio_main_loop.cpp	1970-01-01 00:00:00 +0000
@@ -1,563 +0,0 @@
-/*
- * Copyright © 2013 Canonical Ltd.
- *
- * This program is free software: you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 3,
- * as published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
- */
-
-#include "mir/asio_main_loop.h"
-#include "mir/time/clock.h"
-
-#include "boost/date_time/posix_time/conversion.hpp"
-
-#include <cassert>
-#include <mutex>
-#include <condition_variable>
-
-namespace
-{
-
-void synchronous_server_action(
-    mir::ServerActionQueue& queue,
-    boost::optional<std::thread::id> queue_thread_id,
-    mir::ServerAction const& action)
-{
-    if (!queue_thread_id || *queue_thread_id == std::this_thread::get_id())
-    {
-        try { action(); } catch(...) {}
-    }
-    else
-    {
-        std::mutex done_mutex;
-        bool done{false};
-        std::condition_variable done_condition;
-
-        queue.enqueue(&queue, [&]
-            {
-                std::lock_guard<std::mutex> lock(done_mutex);
-
-                try { action(); } catch(...) {}
-
-                done = true;
-                done_condition.notify_one();
-            });
-
-        std::unique_lock<std::mutex> lock(done_mutex);
-        done_condition.wait(lock, [&] { return done; });
-    }
-}
-
-struct MirClockTimerTraits
-{
-    // TODO the clock used by the main loop is a global setting, this is a restriction
-    // of boost::asio only allowing static methods inside the taits type.
-    struct TimerServiceClockStorage
-    {
-    public:
-        void set_clock(std::shared_ptr<mir::time::Clock const> const& clock)
-        {
-            std::lock_guard<std::mutex> lock(timer_service_mutex);
-            auto stored_clock = timer_service_clock.lock();
-            if (stored_clock && stored_clock != clock)
-                BOOST_THROW_EXCEPTION(std::logic_error("A clock is already in use as time source for mir::AsioMainLoop"));
-            timer_service_clock = clock;
-        }
-        mir::time::Timestamp now()
-        {
-            std::lock_guard<std::mutex> lock(timer_service_mutex);
-            auto clock = timer_service_clock.lock();
-            if (!clock)
-                BOOST_THROW_EXCEPTION(std::logic_error("No clock available to create time stamp"));
-            return clock->now();
-        }
-    private:
-        std::mutex timer_service_mutex;
-        std::weak_ptr<mir::time::Clock const> timer_service_clock;
-    };
-
-    static TimerServiceClockStorage clock_storage;
-
-    static void set_clock(std::shared_ptr<mir::time::Clock const> const& clock)
-    {
-        clock_storage.set_clock(clock);
-    }
-
-    // time_traits interface required by boost::asio::deadline_timer{_service}
-    typedef mir::time::Timestamp time_type;
-    typedef std::chrono::milliseconds duration_type;
-
-
-    static time_type now()
-    {
-        return clock_storage.now();
-    }
-
-    static time_type add(const time_type& t, const duration_type& d)
-    {
-        return t + d;
-    }
-
-    static duration_type subtract(const time_type& t1, const time_type& t2)
-    {
-        return std::chrono::duration_cast<duration_type>(t1 - t2);
-    }
-
-    static bool less_than(const time_type& t1, const time_type& t2)
-    {
-        return t1 < t2;
-    }
-
-    static boost::posix_time::time_duration to_posix_duration(
-        const duration_type& d)
-    {
-        return boost::posix_time::millisec(d.count());
-    }
-};
-
-MirClockTimerTraits::TimerServiceClockStorage MirClockTimerTraits::clock_storage;
-
-typedef boost::asio::basic_deadline_timer<mir::time::Timestamp, MirClockTimerTraits> deadline_timer;
-}
-
-class mir::AsioMainLoop::SignalHandler
-{
-public:
-    SignalHandler(boost::asio::io_service& io,
-                  std::initializer_list<int> signals,
-                  std::function<void(int)> const& handler)
-        : signal_set{io},
-          handler{handler}
-    {
-        for (auto sig : signals)
-            signal_set.add(sig);
-    }
-
-    void async_wait()
-    {
-        signal_set.async_wait(
-            std::bind(&SignalHandler::handle, this,
-                      std::placeholders::_1, std::placeholders::_2));
-    }
-
-private:
-    void handle(boost::system::error_code err, int sig)
-    {
-        if (!err)
-        {
-            handler(sig);
-            signal_set.async_wait(
-                std::bind(&SignalHandler::handle, this,
-                          std::placeholders::_1, std::placeholders::_2));
-        }
-    }
-
-    boost::asio::signal_set signal_set;
-    std::function<void(int)> handler;
-};
-
-class mir::AsioMainLoop::FDHandler
-{
-public:
-    FDHandler(boost::asio::io_service& io,
-              std::initializer_list<int> fds,
-              void const* owner,
-              std::function<void(int)> const& handler)
-        : handler{handler}, owner{owner}
-    {
-        for (auto fd : fds)
-        {
-            auto raw = new boost::asio::posix::stream_descriptor{io, fd};
-            auto s = std::unique_ptr<boost::asio::posix::stream_descriptor>(raw);
-            stream_descriptors.push_back(std::move(s));
-        }
-    }
-
-    ~FDHandler()
-    {
-        for (auto & desc : stream_descriptors)
-        {
-            desc->release(); // release native handle which is not owned by main loop
-        }
-    }
-
-    bool is_owned_by(void const* possible_owner) const
-    {
-        return owner == possible_owner;
-    }
-
-    static void async_wait(std::shared_ptr<FDHandler> const& fd_handler, ServerActionQueue& queue)
-    {
-        for (auto const& s : fd_handler->stream_descriptors)
-            read_some(s.get(), fd_handler, queue);
-    }
-
-private:
-    static void read_some(boost::asio::posix::stream_descriptor* s, std::weak_ptr<FDHandler> const& possible_fd_handler, ServerActionQueue& queue)
-    {
-        s->async_read_some(
-            boost::asio::null_buffers(),
-            [possible_fd_handler,s,&queue](boost::system::error_code err, size_t /*bytes*/)
-            {
-                if (err)
-                    return;
-
-                // The actual execution of the fd handler is moved to the action queue.This allows us to synchronously
-                // unregister FDHandlers even when they are about to be executed. We do this because of the way Asio
-                // copies and executes pending completion handlers.
-                // In worst case during the call to unregister the FDHandler, it may still be executed, but not after
-                // the unregister call returned.
-                queue.enqueue(
-                    s,
-                    [possible_fd_handler, s, &queue]()
-                    {
-                        auto fd_handler = possible_fd_handler.lock();
-                        if (!fd_handler)
-                            return;
-
-                        fd_handler->handler(s->native_handle());
-                        fd_handler.reset();
-
-                        if (possible_fd_handler.lock())
-                            read_some(s, possible_fd_handler, queue);
-                    });
-            });
-    }
-
-    std::vector<std::unique_ptr<boost::asio::posix::stream_descriptor>> stream_descriptors;
-    std::function<void(int)> handler;
-    void const* owner;
-};
-
-/*
- * We need to define the constructor and destructor in the .cpp file,
- * so that we can use unique_ptr to hold SignalHandler. Otherwise, users
- * of AsioMainLoop end up creating constructors and destructors that
- * don't have complete type information for SignalHandler and fail
- * to compile.
- */
-mir::AsioMainLoop::AsioMainLoop(std::shared_ptr<time::Clock> const& clock)
-    : work{io}, clock(clock)
-{
-    MirClockTimerTraits::set_clock(clock);
-}
-
-mir::AsioMainLoop::~AsioMainLoop() noexcept(true)
-{
-}
-
-void mir::AsioMainLoop::run()
-{
-    main_loop_thread = std::this_thread::get_id();
-    io.run();
-}
-
-void mir::AsioMainLoop::stop()
-{
-    io.stop();
-    main_loop_thread.reset();
-}
-
-void mir::AsioMainLoop::register_signal_handler(
-    std::initializer_list<int> signals,
-    std::function<void(int)> const& handler)
-{
-    assert(handler);
-
-    auto sig_handler = std::unique_ptr<SignalHandler>{
-        new SignalHandler{io, signals, handler}};
-
-    sig_handler->async_wait();
-
-    signal_handlers.push_back(std::move(sig_handler));
-}
-
-void mir::AsioMainLoop::register_fd_handler(
-    std::initializer_list<int> fds,
-    void const* owner,
-    std::function<void(int)> const& handler)
-{
-    assert(handler);
-
-    auto fd_handler = std::make_shared<FDHandler>(io, fds, owner, handler);
-
-    FDHandler::async_wait(fd_handler, *this);
-
-    std::lock_guard<std::mutex> lock(fd_handlers_mutex);
-    fd_handlers.push_back(std::move(fd_handler));
-}
-
-void mir::AsioMainLoop::unregister_fd_handler(void const* owner)
-{
-    // synchronous_server_action makes sure that with the
-    // completion of the method unregister_fd_handler the
-    // handler will no longer be called.
-    // There is a chance for a fd handler callback to happen before
-    // the completion of this method.
-    synchronous_server_action(
-        *this,
-        main_loop_thread,
-        [this,owner]()
-        {
-            std::lock_guard<std::mutex> lock(fd_handlers_mutex);
-            auto end_of_valid = remove_if(
-                begin(fd_handlers),
-                end(fd_handlers),
-                [owner](std::shared_ptr<FDHandler> const& item)
-                {
-                    return item->is_owned_by(owner);
-                });
-            fd_handlers.erase(end_of_valid, end(fd_handlers));
-        });
-}
-
-namespace
-{
-class AlarmImpl : public mir::time::Alarm
-{
-public:
-    AlarmImpl(boost::asio::io_service& io,
-              std::chrono::milliseconds delay,
-              std::function<void(void)> callback);
-
-    AlarmImpl(boost::asio::io_service& io,
-              mir::time::Timestamp time_point,
-              std::function<void(void)> callback);
-
-    AlarmImpl(boost::asio::io_service& io,
-              std::function<void(void)> callback);
-
-    ~AlarmImpl() noexcept override;
-
-    bool cancel() override;
-    State state() const override;
-
-    bool reschedule_in(std::chrono::milliseconds delay) override;
-    bool reschedule_for(mir::time::Timestamp time_point) override;
-private:
-    void stop();
-    bool cancel_unlocked();
-    void update_timer();
-    struct InternalState
-    {
-        explicit InternalState(std::function<void(void)> callback)
-            : callback{callback}, state{pending}
-        {
-        }
-
-        std::mutex m;
-        int callbacks_running = 0;
-        std::condition_variable callback_done;
-        std::function<void(void)> const callback;
-        State state;
-    };
-
-    ::deadline_timer timer;
-    std::shared_ptr<InternalState> const data;
-    std::function<void(boost::system::error_code const& ec)> const handler;
-
-    friend auto make_handler(std::weak_ptr<InternalState> possible_data)
-    -> std::function<void(boost::system::error_code const& ec)>;
-};
-
-auto make_handler(std::weak_ptr<AlarmImpl::InternalState> possible_data)
--> std::function<void(boost::system::error_code const& ec)>
-{
-    // Awkwardly, we can't stop the async_wait handler from being called
-    // on a destroyed AlarmImpl. This means we need to wedge a weak_ptr
-    // into the async_wait callback.
-    return [possible_data](boost::system::error_code const& ec)
-    {
-        if (!ec)
-        {
-            if (auto data = possible_data.lock())
-            {
-                std::unique_lock<decltype(data->m)> lock(data->m);
-                if (data->state == mir::time::Alarm::pending)
-                {
-                    data->state = mir::time::Alarm::triggered;
-                    ++data->callbacks_running;
-                    lock.unlock();
-                    data->callback();
-                    lock.lock();
-                    --data->callbacks_running;
-                    data->callback_done.notify_all();
-                }
-            }
-        }
-    };
-}
-
-AlarmImpl::AlarmImpl(boost::asio::io_service& io,
-                     std::chrono::milliseconds delay,
-                     std::function<void ()> callback)
-    : AlarmImpl(io, callback)
-{
-    reschedule_in(delay);
-}
-
-AlarmImpl::AlarmImpl(boost::asio::io_service& io,
-                     mir::time::Timestamp time_point,
-                     std::function<void ()> callback)
-    : AlarmImpl(io, callback)
-{
-    reschedule_for(time_point);
-}
-
-AlarmImpl::AlarmImpl(boost::asio::io_service& io,
-                     std::function<void(void)> callback)
-    : timer{io},
-      data{std::make_shared<InternalState>(callback)},
-      handler{make_handler(data)}
-{
-    data->state = triggered;
-}
-
-AlarmImpl::~AlarmImpl() noexcept
-{
-    AlarmImpl::stop();
-}
-
-void AlarmImpl::stop()
-{
-    std::unique_lock<decltype(data->m)> lock(data->m);
-
-    while (data->callbacks_running > 0)
-        data->callback_done.wait(lock);
-
-    cancel_unlocked();
-}
-
-bool AlarmImpl::cancel()
-{
-    std::lock_guard<decltype(data->m)> lock(data->m);
-    return cancel_unlocked();
-}
-
-bool AlarmImpl::cancel_unlocked()
-{
-    if (data->state == triggered)
-        return false;
-
-    data->state = cancelled;
-    timer.cancel();
-    return true;
-}
-
-mir::time::Alarm::State AlarmImpl::state() const
-{
-    std::lock_guard<decltype(data->m)> lock(data->m);
-
-    return data->state;
-}
-
-bool AlarmImpl::reschedule_in(std::chrono::milliseconds delay)
-{
-    bool cancelling = timer.expires_from_now(delay);
-    update_timer();
-    return cancelling;
-}
-
-bool AlarmImpl::reschedule_for(mir::time::Timestamp time_point)
-{
-    bool cancelling = timer.expires_at(time_point);
-    update_timer();
-    return cancelling;
-}
-
-void AlarmImpl::update_timer()
-{
-    std::lock_guard<decltype(data->m)> lock(data->m);
-    data->state = pending;
-    timer.async_wait(handler);
-}
-}
-
-std::unique_ptr<mir::time::Alarm> mir::AsioMainLoop::notify_in(std::chrono::milliseconds delay,
-                                                               std::function<void()> callback)
-{
-    return std::unique_ptr<mir::time::Alarm>{new AlarmImpl{io, delay, callback}};
-}
-
-std::unique_ptr<mir::time::Alarm> mir::AsioMainLoop::notify_at(mir::time::Timestamp time_point,
-                                                               std::function<void()> callback)
-{
-    return std::unique_ptr<mir::time::Alarm>{new AlarmImpl{io, time_point, callback}};
-}
-
-std::unique_ptr<mir::time::Alarm> mir::AsioMainLoop::create_alarm(std::function<void()> callback)
-{
-    return std::unique_ptr<mir::time::Alarm>{new AlarmImpl{io, callback}};
-}
-
-void mir::AsioMainLoop::enqueue(void const* owner, ServerAction const& action)
-{
-    {
-        std::lock_guard<std::mutex> lock{server_actions_mutex};
-        server_actions.push_back({owner, action});
-    }
-
-    io.post([this] { process_server_actions(); });
-}
-
-void mir::AsioMainLoop::pause_processing_for(void const* owner)
-{
-    std::lock_guard<std::mutex> lock{server_actions_mutex};
-    do_not_process.insert(owner);
-}
-
-void mir::AsioMainLoop::resume_processing_for(void const* owner)
-{
-    {
-        std::lock_guard<std::mutex> lock{server_actions_mutex};
-        do_not_process.erase(owner);
-    }
-
-    io.post([this] { process_server_actions(); });
-}
-
-void mir::AsioMainLoop::process_server_actions()
-{
-    std::unique_lock<std::mutex> lock{server_actions_mutex};
-
-    size_t i = 0;
-
-    while (i < server_actions.size())
-    {
-        /* 
-         * It's safe to use references to elements, since std::deque<>
-         * guarantees that references remain valid after appends, which is
-         * the only operation that can be performed on server_actions outside
-         * this function (in AsioMainLoop::post()).
-         */
-        auto const& owner = server_actions[i].first;
-        auto const& action = server_actions[i].second;
-
-        if (do_not_process.find(owner) == do_not_process.end())
-        {
-            lock.unlock();
-            action();
-            lock.lock();
-            /*
-             * This erase is always ok, since outside this function
-             * we only append to server_actions, i.e., our index i
-             * is guaranteed to remain valid and correct.
-             */
-            server_actions.erase(server_actions.begin() + i);
-        }
-        else
-        {
-            ++i;
-        }
-    }
-}

=== modified file 'src/server/default_server_configuration.cpp'
--- src/server/default_server_configuration.cpp	2014-12-08 04:03:47 +0000
+++ src/server/default_server_configuration.cpp	2015-01-12 11:51:58 +0000
@@ -21,7 +21,6 @@
 #include "mir/options/default_configuration.h"
 #include "mir/abnormal_exit.h"
 #include "mir/glib_main_loop.h"
-#include "mir/asio_main_loop.h"
 #include "mir/default_server_status_listener.h"
 #include "mir/emergency_cleanup.h"
 #include "mir/default_configuration.h"
@@ -167,10 +166,7 @@
     return main_loop(
         [this]() -> std::shared_ptr<mir::MainLoop>
         {
-            if (the_options()->is_set(options::use_asio_main_loop_opt))
-                return std::make_shared<mir::AsioMainLoop>(the_clock());
-            else
-                return std::make_shared<mir::GLibMainLoop>(the_clock());
+            return std::make_shared<mir::GLibMainLoop>(the_clock());
         });
 }
 

=== modified file 'tests/unit-tests/CMakeLists.txt'
--- tests/unit-tests/CMakeLists.txt	2014-12-11 06:14:56 +0000
+++ tests/unit-tests/CMakeLists.txt	2015-01-12 11:51:58 +0000
@@ -26,7 +26,6 @@
 
   test_gmock_fixes.cpp
   test_recursive_read_write_mutex.cpp
-  test_asio_main_loop.cpp
   test_glib_main_loop.cpp
   shared_library_test.cpp
   test_raii.cpp

=== removed file 'tests/unit-tests/test_asio_main_loop.cpp'
--- tests/unit-tests/test_asio_main_loop.cpp	2014-12-08 04:03:47 +0000
+++ tests/unit-tests/test_asio_main_loop.cpp	1970-01-01 00:00:00 +0000
@@ -1,859 +0,0 @@
-/*
- * Copyright © 2013 Canonical Ltd.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- * Authored by: Alexandros Frantzis <alexandros.frantzis@canonical.com>
- */
-
-#include "mir/asio_main_loop.h"
-#include "mir/time/steady_clock.h"
-#include "mir_test/pipe.h"
-#include "mir_test/auto_unblock_thread.h"
-#include "mir_test/signal.h"
-#include "mir_test/wait_object.h"
-#include "mir_test_doubles/advanceable_clock.h"
-
-#include <gtest/gtest.h>
-#include <gmock/gmock.h>
-
-#include <thread>
-#include <atomic>
-#include <functional>
-#include <mutex>
-#include <condition_variable>
-#include <array>
-#include <boost/throw_exception.hpp>
-
-#include <sys/types.h>
-#include <unistd.h>
-
-namespace mt = mir::test;
-namespace mtd = mir::test::doubles;
-
-namespace
-{
-
-class AsioMainLoopTest : public ::testing::Test
-{
-public:
-    mir::AsioMainLoop ml{std::make_shared<mir::time::SteadyClock>()};
-};
-
-struct AdvanceableClock : mtd::AdvanceableClock
-{
-    void advance_by(mir::time::Duration step, mir::AsioMainLoop& ml)
-    {
-        mtd::AdvanceableClock::advance_by(step);
-
-        bool done = false;
-        std::mutex checkpoint_mutex;
-        std::condition_variable checkpoint;
-
-        auto evaluate_clock_alarm = ml.notify_in(
-            std::chrono::milliseconds{0},
-            [&done, &checkpoint_mutex, &checkpoint]
-            {
-                std::unique_lock<std::mutex> lock(checkpoint_mutex);
-                done = true;
-                checkpoint.notify_one();
-            });
-
-        std::unique_lock<std::mutex> lock(checkpoint_mutex);
-        while(!done) checkpoint.wait(lock);
-    }
-};
-
-
-class AsioMainLoopAlarmTest : public ::testing::Test
-{
-public:
-    std::shared_ptr<AdvanceableClock> clock = std::make_shared<AdvanceableClock>();
-    mir::AsioMainLoop ml{clock};
-    int call_count{0};
-    mt::WaitObject wait;
-    std::chrono::milliseconds delay{50};
-
-};
-
-struct UnblockMainLoop : mt::AutoUnblockThread
-{
-    UnblockMainLoop(mir::AsioMainLoop & loop)
-        : mt::AutoUnblockThread([&loop]() {loop.stop();},
-                                [&loop]() {loop.run();})
-    {}
-};
-
-class Counter
-{
-public:
-    int operator++()
-    {
-        std::lock_guard<decltype(mutex)> lock(mutex);
-        cv.notify_one();
-        return ++counter;
-    }
-
-    bool wait_for(std::chrono::milliseconds const& delay, int expected)
-    {
-        std::unique_lock<decltype(mutex)> lock(mutex);
-        return cv.wait_for(lock, delay, [&]{ return counter == expected;});
-    }
-
-    operator int() const
-    {
-        std::lock_guard<decltype(mutex)> lock(mutex);
-        return counter;
-    }
-
-private:
-    std::mutex mutable mutex;
-    std::condition_variable cv;
-    int counter{0};
-};
-}
-
-TEST_F(AsioMainLoopTest, signal_handled)
-{
-    int const signum{SIGUSR1};
-    int handled_signum{0};
-
-    ml.register_signal_handler(
-        {signum},
-        [&handled_signum, this](int sig)
-        {
-           handled_signum = sig;
-           ml.stop();
-        });
-
-    kill(getpid(), signum);
-
-    ml.run();
-
-    ASSERT_EQ(signum, handled_signum);
-}
-
-
-TEST_F(AsioMainLoopTest, multiple_signals_handled)
-{
-    std::vector<int> const signals{SIGUSR1, SIGUSR2};
-    size_t const num_signals_to_send{10};
-    std::vector<int> handled_signals;
-    std::atomic<unsigned int> num_handled_signals{0};
-
-    ml.register_signal_handler(
-        {signals[0], signals[1]},
-        [&handled_signals, &num_handled_signals](int sig)
-        {
-           handled_signals.push_back(sig);
-           ++num_handled_signals;
-        });
-
-
-    std::thread signal_sending_thread(
-        [this, num_signals_to_send, &signals, &num_handled_signals]
-        {
-            for (size_t i = 0; i < num_signals_to_send; i++)
-            {
-                kill(getpid(), signals[i % signals.size()]);
-                while (num_handled_signals <= i) std::this_thread::yield();
-            }
-            ml.stop();
-        });
-
-    ml.run();
-
-    signal_sending_thread.join();
-
-    ASSERT_EQ(num_signals_to_send, handled_signals.size());
-
-    for (size_t i = 0; i < num_signals_to_send; i++)
-        ASSERT_EQ(signals[i % signals.size()], handled_signals[i]) << " index " << i;
-}
-
-TEST_F(AsioMainLoopTest, all_registered_handlers_are_called)
-{
-    int const signum{SIGUSR1};
-    std::vector<int> handled_signum{0,0,0};
-
-    ml.register_signal_handler(
-        {signum},
-        [&handled_signum, this](int sig)
-        {
-            handled_signum[0] = sig;
-            if (handled_signum[0] != 0 &&
-                handled_signum[1] != 0 &&
-                handled_signum[2] != 0)
-            {
-                ml.stop();
-            }
-        });
-
-    ml.register_signal_handler(
-        {signum},
-        [&handled_signum, this](int sig)
-        {
-            handled_signum[1] = sig;
-            if (handled_signum[0] != 0 &&
-                handled_signum[1] != 0 &&
-                handled_signum[2] != 0)
-            {
-                ml.stop();
-            }
-        });
-
-    ml.register_signal_handler(
-        {signum},
-        [&handled_signum, this](int sig)
-        {
-            handled_signum[2] = sig;
-            if (handled_signum[0] != 0 &&
-                handled_signum[1] != 0 &&
-                handled_signum[2] != 0)
-            {
-                ml.stop();
-            }
-        });
-
-    kill(getpid(), signum);
-
-    ml.run();
-
-    ASSERT_EQ(signum, handled_signum[0]);
-    ASSERT_EQ(signum, handled_signum[1]);
-    ASSERT_EQ(signum, handled_signum[2]);
-}
-
-TEST_F(AsioMainLoopTest, fd_data_handled)
-{
-    mt::Pipe p;
-    char const data_to_write{'a'};
-    int handled_fd{0};
-    char data_read{0};
-
-    ml.register_fd_handler(
-        {p.read_fd()},
-        this,
-        [&handled_fd, &data_read, this](int fd)
-        {
-            handled_fd = fd;
-            EXPECT_EQ(1, read(fd, &data_read, 1));
-            ml.stop();
-        });
-
-    EXPECT_EQ(1, write(p.write_fd(), &data_to_write, 1));
-
-    ml.run();
-
-    EXPECT_EQ(data_to_write, data_read);
-}
-
-TEST_F(AsioMainLoopTest, multiple_fds_with_single_handler_handled)
-{
-    std::vector<mt::Pipe> const pipes(2);
-    size_t const num_elems_to_send{10};
-    std::vector<int> handled_fds;
-    std::vector<size_t> elems_read;
-    std::atomic<unsigned int> num_handled_fds{0};
-
-    ml.register_fd_handler(
-        {pipes[0].read_fd(), pipes[1].read_fd()},
-        this,
-        [&handled_fds, &elems_read, &num_handled_fds](int fd)
-        {
-            handled_fds.push_back(fd);
-
-            size_t i;
-            EXPECT_EQ(static_cast<ssize_t>(sizeof(i)),
-                      read(fd, &i, sizeof(i)));
-            elems_read.push_back(i);
-
-            ++num_handled_fds;
-        });
-
-    std::thread fd_writing_thread{
-        [this, num_elems_to_send, &pipes, &num_handled_fds]
-        {
-            for (size_t i = 0; i < num_elems_to_send; i++)
-            {
-                EXPECT_EQ(static_cast<ssize_t>(sizeof(i)),
-                          write(pipes[i % pipes.size()].write_fd(), &i, sizeof(i)));
-                while (num_handled_fds <= i) std::this_thread::yield();
-            }
-            ml.stop();
-        }};
-
-    ml.run();
-
-    fd_writing_thread.join();
-
-    ASSERT_EQ(num_elems_to_send, handled_fds.size());
-    ASSERT_EQ(num_elems_to_send, elems_read.size());
-
-    for (size_t i = 0; i < num_elems_to_send; i++)
-    {
-        EXPECT_EQ(pipes[i % pipes.size()].read_fd(), handled_fds[i]) << " index " << i;
-        EXPECT_EQ(i, elems_read[i]) << " index " << i;
-    }
-}
-
-TEST_F(AsioMainLoopTest, multiple_fd_handlers_are_called)
-{
-    std::vector<mt::Pipe> const pipes(3);
-    std::vector<int> const elems_to_send{10,11,12};
-    std::vector<int> handled_fds{0,0,0};
-    std::vector<int> elems_read{0,0,0};
-
-    ml.register_fd_handler(
-        {pipes[0].read_fd()},
-        this,
-        [&handled_fds, &elems_read, this](int fd)
-        {
-            EXPECT_EQ(static_cast<ssize_t>(sizeof(elems_read[0])),
-                      read(fd, &elems_read[0], sizeof(elems_read[0])));
-            handled_fds[0] = fd;
-            if (handled_fds[0] != 0 &&
-                handled_fds[1] != 0 &&
-                handled_fds[2] != 0)
-            {
-                ml.stop();
-            }
-        });
-
-    ml.register_fd_handler(
-        {pipes[1].read_fd()},
-        this,
-        [&handled_fds, &elems_read, this](int fd)
-        {
-            EXPECT_EQ(static_cast<ssize_t>(sizeof(elems_read[1])),
-                      read(fd, &elems_read[1], sizeof(elems_read[1])));
-            handled_fds[1] = fd;
-            if (handled_fds[0] != 0 &&
-                handled_fds[1] != 0 &&
-                handled_fds[2] != 0)
-            {
-                ml.stop();
-            }
-        });
-
-    ml.register_fd_handler(
-        {pipes[2].read_fd()},
-        this,
-        [&handled_fds, &elems_read, this](int fd)
-        {
-            EXPECT_EQ(static_cast<ssize_t>(sizeof(elems_read[2])),
-                      read(fd, &elems_read[2], sizeof(elems_read[2])));
-            handled_fds[2] = fd;
-            if (handled_fds[0] != 0 &&
-                handled_fds[1] != 0 &&
-                handled_fds[2] != 0)
-            {
-                ml.stop();
-            }
-        });
-
-    EXPECT_EQ(static_cast<ssize_t>(sizeof(elems_to_send[0])),
-              write(pipes[0].write_fd(), &elems_to_send[0], sizeof(elems_to_send[0])));
-    EXPECT_EQ(static_cast<ssize_t>(sizeof(elems_to_send[1])),
-              write(pipes[1].write_fd(), &elems_to_send[1], sizeof(elems_to_send[1])));
-    EXPECT_EQ(static_cast<ssize_t>(sizeof(elems_to_send[2])),
-              write(pipes[2].write_fd(), &elems_to_send[2], sizeof(elems_to_send[2])));
-
-    ml.run();
-
-    EXPECT_EQ(pipes[0].read_fd(), handled_fds[0]);
-    EXPECT_EQ(pipes[1].read_fd(), handled_fds[1]);
-    EXPECT_EQ(pipes[2].read_fd(), handled_fds[2]);
-
-    EXPECT_EQ(elems_to_send[0], elems_read[0]);
-    EXPECT_EQ(elems_to_send[1], elems_read[1]);
-    EXPECT_EQ(elems_to_send[2], elems_read[2]);
-}
-
-TEST_F(AsioMainLoopTest, unregister_prevents_callback_and_does_not_harm_other_callbacks)
-{
-    mt::Pipe p1, p2;
-    char const data_to_write{'a'};
-    int p2_handler_executes{-1};
-    char data_read{0};
-
-    ml.register_fd_handler(
-        {p1.read_fd()},
-        this,
-        [this](int)
-        {
-            FAIL() << "unregistered handler called";
-            ml.stop();
-        });
-
-    ml.register_fd_handler(
-        {p2.read_fd()},
-        this+2,
-        [&p2_handler_executes,&data_read,this](int fd)
-        {
-            p2_handler_executes = fd;
-            EXPECT_EQ(1, read(fd, &data_read, 1));
-            ml.stop();
-        });
-
-    ml.unregister_fd_handler(this);
-
-    EXPECT_EQ(1, write(p1.write_fd(), &data_to_write, 1));
-    EXPECT_EQ(1, write(p2.write_fd(), &data_to_write, 1));
-
-    ml.run();
-
-    EXPECT_EQ(data_to_write, data_read);
-    EXPECT_EQ(p2.read_fd(), p2_handler_executes);
-}
-
-TEST_F(AsioMainLoopTest, unregister_does_not_close_fds)
-{
-    mt::Pipe p1, p2;
-    char const data_to_write{'b'};
-    char data_read{0};
-
-    ml.register_fd_handler(
-        {p1.read_fd()},
-        this,
-        [this](int)
-        {
-            FAIL() << "unregistered handler called";
-            ml.stop();
-        });
-
-    ml.unregister_fd_handler(this);
-
-    ml.register_fd_handler(
-        {p1.read_fd()},
-        this,
-        [this,&data_read](int fd)
-        {
-            EXPECT_EQ(1, read(fd, &data_read, 1));
-            ml.stop();
-        });
-
-    EXPECT_EQ(1, write(p1.write_fd(), &data_to_write, 1));
-
-    ml.run();
-
-    EXPECT_EQ(data_to_write, data_read);
-}
-
-TEST_F(AsioMainLoopAlarmTest, main_loop_runs_until_stop_called)
-{
-    auto mainloop_started = std::make_shared<mt::Signal>();
-
-    auto fire_on_mainloop_start = ml.notify_in(std::chrono::milliseconds{0},
-                                               [mainloop_started]()
-    {
-        mainloop_started->raise();
-    });
-
-    UnblockMainLoop unblocker(ml);
-
-    ASSERT_TRUE(mainloop_started->wait_for(std::chrono::milliseconds{100}));
-
-    auto timer_fired = std::make_shared<mt::Signal>();
-    auto alarm = ml.notify_in(std::chrono::milliseconds{10}, [timer_fired]
-    {
-        timer_fired->raise();
-    });
-
-    clock->advance_by(std::chrono::milliseconds{10}, ml);
-    EXPECT_TRUE(timer_fired->wait_for(std::chrono::milliseconds{500}));
-
-    ml.stop();
-    // Main loop should be stopped now
-
-    timer_fired = std::make_shared<mt::Signal>();
-    auto should_not_fire =  ml.notify_in(std::chrono::milliseconds{0},
-                                         [timer_fired]()
-    {
-        timer_fired->raise();
-    });
-
-    EXPECT_FALSE(timer_fired->wait_for(std::chrono::milliseconds{100}));
-}
-
-TEST_F(AsioMainLoopAlarmTest, alarm_starts_in_pending_state)
-{
-    auto alarm = ml.notify_in(delay, [this]() {});
-
-    UnblockMainLoop unblocker(ml);
-
-    EXPECT_EQ(mir::time::Alarm::pending, alarm->state());
-}
-
-TEST_F(AsioMainLoopAlarmTest, alarm_fires_with_correct_delay)
-{
-    UnblockMainLoop unblocker(ml);
-
-    auto alarm = ml.notify_in(delay, [](){});
-
-    clock->advance_by(delay - std::chrono::milliseconds{1}, ml);
-    EXPECT_EQ(mir::time::Alarm::pending, alarm->state());
-
-    clock->advance_by(delay, ml);
-    EXPECT_EQ(mir::time::Alarm::triggered, alarm->state());
-}
-
-TEST_F(AsioMainLoopAlarmTest, multiple_alarms_fire)
-{
-    using namespace testing;
-
-    int const alarm_count{10};
-    Counter call_count;
-    std::array<std::unique_ptr<mir::time::Alarm>, alarm_count> alarms;
-
-    for (auto& alarm : alarms)
-        alarm = ml.notify_in(delay, [&call_count](){++call_count;});
-
-    UnblockMainLoop unblocker(ml);
-    clock->advance_by(delay, ml);
-
-    call_count.wait_for(delay, alarm_count);
-    EXPECT_THAT(call_count, Eq(alarm_count));
-
-    for (auto const& alarm : alarms)
-        EXPECT_EQ(mir::time::Alarm::triggered, alarm->state());
-}
-
-TEST_F(AsioMainLoopAlarmTest, alarm_changes_to_triggered_state)
-{
-    auto alarm_fired = std::make_shared<mt::Signal>();
-    auto alarm = ml.notify_in(std::chrono::milliseconds{5}, [alarm_fired]()
-    {
-        alarm_fired->raise();
-    });
-
-    UnblockMainLoop unblocker(ml);
-
-    clock->advance_by(delay, ml);
-    ASSERT_TRUE(alarm_fired->wait_for(std::chrono::milliseconds{100}));
-
-    EXPECT_EQ(mir::time::Alarm::triggered, alarm->state());
-}
-
-TEST_F(AsioMainLoopAlarmTest, cancelled_alarm_doesnt_fire)
-{
-    UnblockMainLoop unblocker(ml);
-    auto alarm = ml.notify_in(std::chrono::milliseconds{100},
-                              [](){ FAIL() << "Alarm handler of canceld alarm called";});
-
-    EXPECT_TRUE(alarm->cancel());
-
-    EXPECT_EQ(mir::time::Alarm::cancelled, alarm->state());
-
-    clock->advance_by(std::chrono::milliseconds{100}, ml);
-
-    EXPECT_EQ(mir::time::Alarm::cancelled, alarm->state());
-}
-
-TEST_F(AsioMainLoopAlarmTest, destroyed_alarm_doesnt_fire)
-{
-    auto alarm = ml.notify_in(std::chrono::milliseconds{200},
-                              [](){ FAIL() << "Alarm handler of destroyed alarm called"; });
-
-    UnblockMainLoop unblocker(ml);
-
-    alarm.reset(nullptr);
-    clock->advance_by(std::chrono::milliseconds{200}, ml);
-}
-
-TEST_F(AsioMainLoopAlarmTest, rescheduled_alarm_fires_again)
-{
-    std::atomic<int> call_count{0};
-
-    auto alarm = ml.notify_in(std::chrono::milliseconds{0}, [&call_count]()
-    {
-        if (call_count++ > 1)
-            FAIL() << "Alarm called too many times";
-    });
-
-    UnblockMainLoop unblocker(ml);
-
-    clock->advance_by(std::chrono::milliseconds{0}, ml);
-    ASSERT_EQ(mir::time::Alarm::triggered, alarm->state());
-
-    alarm->reschedule_in(std::chrono::milliseconds{100});
-    EXPECT_EQ(mir::time::Alarm::pending, alarm->state());
-
-    clock->advance_by(std::chrono::milliseconds{100}, ml);
-    EXPECT_EQ(mir::time::Alarm::triggered, alarm->state());
-}
-
-TEST_F(AsioMainLoopAlarmTest, rescheduled_alarm_cancels_previous_scheduling)
-{
-    std::atomic<int> call_count{0};
-
-    auto alarm = ml.notify_in(std::chrono::milliseconds{100}, [&call_count]()
-    {
-        call_count++;
-    });
-
-    UnblockMainLoop unblocker(ml);
-    clock->advance_by(std::chrono::milliseconds{90}, ml);
-
-    EXPECT_EQ(mir::time::Alarm::pending, alarm->state());
-    EXPECT_EQ(0, call_count);
-    EXPECT_TRUE(alarm->reschedule_in(std::chrono::milliseconds{100}));
-    EXPECT_EQ(mir::time::Alarm::pending, alarm->state());
-
-    clock->advance_by(std::chrono::milliseconds{110}, ml);
-
-    EXPECT_EQ(mir::time::Alarm::triggered, alarm->state());
-    EXPECT_EQ(1, call_count);
-}
-
-TEST_F(AsioMainLoopAlarmTest, alarm_callback_cannot_deadlock)
-{   // Regression test for deadlock bug LP: #1339700
-    std::timed_mutex m;
-    std::atomic_bool failed(false);
-    int i = 0;
-    int const loops = 5;
-
-    auto alarm = ml.notify_in(std::chrono::milliseconds{0}, [&]()
-    {
-        // From this angle, ensure we can lock m (alarm should be unlocked)
-        failed = !m.try_lock_for(std::chrono::seconds{5});
-        ASSERT_FALSE(failed);
-        ++i;
-        m.unlock();
-    });
-
-    std::thread t([&]()
-        {
-            m.lock();
-            while (i < loops && !failed)
-            {
-                // From this angle, ensure we can lock alarm while holding m
-                (void)alarm->state();
-                m.unlock();
-                std::this_thread::yield();
-                m.lock();
-            }
-            m.unlock();
-        });
-
-    UnblockMainLoop unblocker(ml);
-    for (int j = 0; j < loops; ++j)
-    {
-        clock->advance_by(std::chrono::milliseconds{11}, ml);
-        alarm->reschedule_in(std::chrono::milliseconds{10});
-    }
-
-    t.join();
-}
-
-TEST_F(AsioMainLoopAlarmTest, alarm_fires_at_correct_time_point)
-{
-    mir::time::Timestamp real_soon = clock->now() + std::chrono::milliseconds{120};
-
-    auto alarm = ml.notify_at(real_soon, []{});
-
-    UnblockMainLoop unblocker(ml);
-
-    clock->advance_by(std::chrono::milliseconds{119}, ml);
-    EXPECT_EQ(mir::time::Alarm::pending, alarm->state());
-
-    clock->advance_by(std::chrono::milliseconds{1}, ml);
-    EXPECT_EQ(mir::time::Alarm::triggered, alarm->state());
-}
-
-TEST_F(AsioMainLoopTest, dispatches_action)
-{
-    using namespace testing;
-
-    int num_actions{0};
-    int const owner{0};
-
-    ml.enqueue(
-        &owner,
-        [&]
-        {
-            ++num_actions;
-            ml.stop();
-        });
-
-    ml.run();
-
-    EXPECT_THAT(num_actions, Eq(1));
-}
-
-TEST_F(AsioMainLoopTest, dispatches_multiple_actions_in_order)
-{
-    using namespace testing;
-
-    int const num_actions{5};
-    std::vector<int> actions;
-    int const owner{0};
-
-    for (int i = 0; i < num_actions; ++i)
-    {
-        ml.enqueue(
-            &owner,
-            [&,i]
-            {
-                actions.push_back(i);
-                if (i == num_actions - 1)
-                    ml.stop();
-            });
-    }
-
-    ml.run();
-
-    ASSERT_THAT(actions.size(), Eq(num_actions));
-    for (int i = 0; i < num_actions; ++i)
-        EXPECT_THAT(actions[i], Eq(i)) << "i = " << i;
-}
-
-TEST_F(AsioMainLoopTest, does_not_dispatch_paused_actions)
-{
-    using namespace testing;
-
-    std::vector<int> actions;
-    int const owner1{0};
-    int const owner2{0};
-
-    ml.enqueue(
-        &owner1,
-
-        [&]
-        {
-            int const id = 0;
-            actions.push_back(id);
-        });
-
-    ml.enqueue(
-        &owner2,
-        [&]
-        {
-            int const id = 1;
-            actions.push_back(id);
-        });
-
-    ml.enqueue(
-        &owner1,
-        [&]
-        {
-            int const id = 2;
-            actions.push_back(id);
-        });
-
-    ml.enqueue(
-        &owner2,
-        [&]
-        {
-            int const id = 3;
-            actions.push_back(id);
-            ml.stop();
-        });
-
-    ml.pause_processing_for(&owner1);
-
-    ml.run();
-
-    ASSERT_THAT(actions.size(), Eq(2));
-    EXPECT_THAT(actions[0], Eq(1));
-    EXPECT_THAT(actions[1], Eq(3));
-}
-
-TEST_F(AsioMainLoopTest, dispatches_resumed_actions)
-{
-    using namespace testing;
-
-    std::vector<int> actions;
-    void const* const owner1_ptr{&actions};
-    int const owner2{0};
-
-    ml.enqueue(
-        owner1_ptr,
-        [&]
-        {
-            int const id = 0;
-            actions.push_back(id);
-            ml.stop();
-        });
-
-    ml.enqueue(
-        &owner2,
-        [&]
-        {
-            int const id = 1;
-            actions.push_back(id);
-            ml.resume_processing_for(owner1_ptr);
-        });
-
-    ml.pause_processing_for(owner1_ptr);
-
-    ml.run();
-
-    ASSERT_THAT(actions.size(), Eq(2));
-    EXPECT_THAT(actions[0], Eq(1));
-    EXPECT_THAT(actions[1], Eq(0));
-}
-
-TEST_F(AsioMainLoopTest, handles_enqueue_from_within_action)
-{
-    using namespace testing;
-
-    std::vector<int> actions;
-    int const num_actions{10};
-    void const* const owner{&num_actions};
-
-    ml.enqueue(
-        owner,
-        [&]
-        {
-            int const id = 0;
-            actions.push_back(id);
-            
-            for (int i = 1; i < num_actions; ++i)
-            {
-                ml.enqueue(
-                    owner,
-                    [&,i]
-                    {
-                        actions.push_back(i);
-                        if (i == num_actions - 1)
-                            ml.stop();
-                    });
-            }
-        });
-
-    ml.run();
-
-    ASSERT_THAT(actions.size(), Eq(num_actions));
-    for (int i = 0; i < num_actions; ++i)
-        EXPECT_THAT(actions[i], Eq(i)) << "i = " << i;
-}
-
-// More targeted regression test for LP: #1381925
-TEST_F(AsioMainLoopTest, stress_emits_alarm_notification_with_zero_timeout)
-{
-    using namespace ::testing;
-
-    UnblockMainLoop unblocker{ml};
-
-    for (int i = 0; i < 1000; ++i)
-    {
-        mt::WaitObject notification_called;
-
-        auto alarm = ml.notify_in(
-            std::chrono::milliseconds{0},
-            [&] { notification_called.notify_ready(); });
-
-        notification_called.wait_until_ready(std::chrono::seconds{5});
-    }
-}

