From 57249ca32c7b0684be36f5195d4967e6517fe75b Mon Sep 17 00:00:00 2001 From: John Firebaugh Date: Wed, 3 Dec 2014 17:02:38 -0800 Subject: Prefer stdlib to libuv (fixes #688) --- include/mbgl/util/uv.hpp | 1 - include/mbgl/util/uv_detail.hpp | 48 ----------------------------------------- 2 files changed, 49 deletions(-) (limited to 'include/mbgl/util') diff --git a/include/mbgl/util/uv.hpp b/include/mbgl/util/uv.hpp index 2fc3e0dc30..74ed9c87a8 100644 --- a/include/mbgl/util/uv.hpp +++ b/include/mbgl/util/uv.hpp @@ -12,7 +12,6 @@ namespace uv { std::string cwd(); -class thread; class rwlock; class loop; class async; diff --git a/include/mbgl/util/uv_detail.hpp b/include/mbgl/util/uv_detail.hpp index b6b9be208d..99f5edc145 100644 --- a/include/mbgl/util/uv_detail.hpp +++ b/include/mbgl/util/uv_detail.hpp @@ -20,30 +20,6 @@ void close(std::unique_ptr ptr) { }); } -class thread : public mbgl::util::noncopyable { -public: - inline thread(std::function fn_) - : fn(fn_) { - if (uv_thread_create(&t, thread_cb, this) != 0) { - throw std::runtime_error("failed to initialize thread"); - } - } - - void join() { - if (uv_thread_join(&t) != 0) { - throw std::runtime_error("failed to join thred"); - } - } - -private: - static void thread_cb(void* data) { - reinterpret_cast(data)->fn(); - } - - uv_thread_t t; - std::function fn; -}; - class loop : public mbgl::util::noncopyable { public: inline loop() { @@ -109,30 +85,6 @@ private: std::function fn; }; -class mutex : public mbgl::util::noncopyable { -public: - inline mutex() { - if (uv_mutex_init(&mtx) != 0) { - throw std::runtime_error("failed to initialize mutex"); - } - } - inline ~mutex() { uv_mutex_destroy(&mtx); } - inline void lock() { uv_mutex_lock(&mtx); } - inline void unlock() { uv_mutex_unlock(&mtx); } - -private: - uv_mutex_t mtx; -}; - -class lock : public mbgl::util::noncopyable { -public: - lock(mutex &mtx_) : mtx(mtx_) { mtx.lock(); } - ~lock() { mtx.unlock(); } - -private: - mutex &mtx; -}; - class rwlock : public mbgl::util::noncopyable { public: inline rwlock() { -- cgit v1.2.1