X-Git-Url: http://plrg.eecs.uci.edu/git/?a=blobdiff_plain;f=folly%2FThreadLocal.h;h=6a256c9c588b4e3d8430d09c27dd31e5cb218129;hb=492fad43a76506407008a5394511daf6bba5bccc;hp=3c05074463e8ded6ff54928886b5fd748a8d2a63;hpb=d4aacd244f21e76dce685365acc281a9015897c1;p=folly.git diff --git a/folly/ThreadLocal.h b/folly/ThreadLocal.h index 3c050744..6a256c9c 100644 --- a/folly/ThreadLocal.h +++ b/folly/ThreadLocal.h @@ -1,5 +1,5 @@ /* - * Copyright 2017 Facebook, Inc. + * Copyright 2011-present Facebook, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -161,7 +161,7 @@ class ThreadLocalPtr { } T* get() const { - threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_); + threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); return static_cast(w.ptr); } @@ -174,14 +174,14 @@ class ThreadLocalPtr { } T* release() { - threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_); + threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); return static_cast(w.release()); } void reset(T* newPtr = nullptr) { auto guard = makeGuard([&] { delete newPtr; }); - threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_); + threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); w.dispose(TLPDestructionMode::THIS_THREAD); guard.dismiss(); @@ -235,7 +235,7 @@ class ThreadLocalPtr { deleter(newPtr, TLPDestructionMode::THIS_THREAD); } }); - threadlocal_detail::ElementWrapper& w = StaticMeta::instance().get(&id_); + threadlocal_detail::ElementWrapper& w = StaticMeta::get(&id_); w.dispose(TLPDestructionMode::THIS_THREAD); guard.dismiss(); w.set(newPtr, deleter);