diff options
Diffstat (limited to 'src/mbgl/util/thread_local.hpp')
-rw-r--r-- | src/mbgl/util/thread_local.hpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mbgl/util/thread_local.hpp b/src/mbgl/util/thread_local.hpp index c3364c5d42..67e3842ec6 100644 --- a/src/mbgl/util/thread_local.hpp +++ b/src/mbgl/util/thread_local.hpp @@ -12,12 +12,12 @@ namespace util { template <class T> class ThreadLocal : public noncopyable { public: - inline ThreadLocal(T* val) { + ThreadLocal(T* val) { ThreadLocal(); set(val); } - inline ThreadLocal() { + ThreadLocal() { int ret = pthread_key_create(&key, [](void *ptr) { delete reinterpret_cast<T *>(ptr); }); @@ -27,13 +27,13 @@ public: } } - inline ~ThreadLocal() { + ~ThreadLocal() { if (pthread_key_delete(key)) { throw std::runtime_error("Failed to delete local storage key."); } } - inline T* get() { + T* get() { T* ret = reinterpret_cast<T*>(pthread_getspecific(key)); if (!ret) { return nullptr; @@ -42,7 +42,7 @@ public: return ret; } - inline void set(T* ptr) { + void set(T* ptr) { if (pthread_setspecific(key, ptr)) { throw std::runtime_error("Failed to set local storage."); } |