proxygen
|
#include <folly/ThreadLocal.h>
#include <dlfcn.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <array>
#include <atomic>
#include <chrono>
#include <climits>
#include <condition_variable>
#include <map>
#include <memory>
#include <mutex>
#include <set>
#include <thread>
#include <unordered_map>
#include <glog/logging.h>
#include <folly/Memory.h>
#include <folly/experimental/io/FsUtil.h>
#include <folly/portability/GTest.h>
#include <folly/portability/Unistd.h>
#include <folly/synchronization/Baton.h>
#include <folly/synchronization/detail/ThreadCachedInts.h>
#include <folly/system/ThreadId.h>
Go to the source code of this file.
Classes | |
class | Widget |
struct | MultiWidget |
class | SimpleThreadCachedInt |
struct | HoldsOneTag2 |
struct | folly::threadlocal_detail::PthreadKeyUnregisterTester |
Namespaces | |
folly | |
—— Concurrent Priority Queue Implementation —— | |
folly::threadlocal_detail | |
Macros | |
#define | SHARED_LIBRARY_TEST_NAME DISABLED_SharedLibrary |
Functions | |
TEST (ThreadLocalPtr, BasicDestructor) | |
TEST (ThreadLocalPtr, CustomDeleter1) | |
TEST (ThreadLocalPtr, CustomDeleterOwnershipTransfer) | |
TEST (ThreadLocalPtr, DefaultDeleterOwnershipTransfer) | |
TEST (ThreadLocalPtr, resetNull) | |
TEST (ThreadLocalPtr, TestRelease) | |
TEST (ThreadLocalPtr, CreateOnThreadExit) | |
TEST (ThreadLocalPtr, CustomDeleter2) | |
TEST (ThreadLocal, BasicDestructor) | |
TEST (ThreadLocal, ReallocDestructor) | |
TEST (ThreadLocal, SimpleRepeatDestructor) | |
TEST (ThreadLocal, InterleavedDestructors) | |
TEST (ThreadLocalPtr, AccessAllThreadsCounter) | |
TEST (ThreadLocal, resetNull) | |
TEST (ThreadLocal, Movable1) | |
TEST (ThreadLocal, Movable2) | |
TEST (ThreadLocal, TCICreateOnThreadExit) | |
TEST (ThreadLocal, Stress) | |
TEST (ThreadLocal, Fork2) | |
TEST (ThreadLocal, DISABLED_SharedLibrary) | |
TEST (ThreadLocal, UnregisterClassHasConstExprCtor) | |
#define SHARED_LIBRARY_TEST_NAME DISABLED_SharedLibrary |
Definition at line 667 of file ThreadLocalTest.cpp.
TEST | ( | ThreadLocalPtr | , |
BasicDestructor | |||
) |
Definition at line 81 of file ThreadLocalTest.cpp.
References EXPECT_EQ, folly::ThreadLocalPtr< T, Tag, AccessMode >::get(), folly::join(), folly::ThreadLocalPtr< T, Tag, AccessMode >::reset(), and Widget::totalVal_.
TEST | ( | ThreadLocalPtr | , |
CustomDeleter1 | |||
) |
Definition at line 92 of file ThreadLocalTest.cpp.
References Widget::customDeleter(), EXPECT_EQ, folly::ThreadLocalPtr< T, Tag, AccessMode >::get(), folly::join(), folly::ThreadLocalPtr< T, Tag, AccessMode >::reset(), and Widget::totalVal_.
TEST | ( | ThreadLocalPtr | , |
CustomDeleterOwnershipTransfer | |||
) |
Definition at line 106 of file ThreadLocalTest.cpp.
References Widget::customDeleter(), EXPECT_EQ, folly::ThreadLocalPtr< T, Tag, AccessMode >::get(), folly::join(), folly::gen::move, ptr, folly::ThreadLocalPtr< T, Tag, AccessMode >::reset(), folly::THIS_THREAD, and Widget::totalVal_.
TEST | ( | ThreadLocalPtr | , |
DefaultDeleterOwnershipTransfer | |||
) |
Definition at line 124 of file ThreadLocalTest.cpp.
References EXPECT_EQ, folly::ThreadLocalPtr< T, Tag, AccessMode >::get(), folly::join(), folly::gen::move, folly::ThreadLocalPtr< T, Tag, AccessMode >::reset(), and Widget::totalVal_.
TEST | ( | ThreadLocalPtr | , |
resetNull | |||
) |
Definition at line 139 of file ThreadLocalTest.cpp.
References EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, folly::ThreadLocalPtr< T, Tag, AccessMode >::get(), and folly::ThreadLocalPtr< T, Tag, AccessMode >::reset().
TEST | ( | ThreadLocalPtr | , |
TestRelease | |||
) |
Definition at line 149 of file ThreadLocalTest.cpp.
References EXPECT_EQ, folly::ThreadLocalPtr< T, Tag, AccessMode >::get(), folly::join(), folly::ThreadLocalPtr< T, Tag, AccessMode >::release(), folly::ThreadLocalPtr< T, Tag, AccessMode >::reset(), and Widget::totalVal_.
TEST | ( | ThreadLocalPtr | , |
CreateOnThreadExit | |||
) |
Definition at line 165 of file ThreadLocalTest.cpp.
References EXPECT_EQ, folly::ThreadLocal< T, Tag, AccessMode >::get(), folly::join(), ptr, folly::ThreadLocalPtr< T, Tag, AccessMode >::reset(), and Widget::totalVal_.
TEST | ( | ThreadLocalPtr | , |
CustomDeleter2 | |||
) |
Definition at line 184 of file ThreadLocalTest.cpp.
References Widget::customDeleter(), EXPECT_EQ, folly::ThreadLocalPtr< T, Tag, AccessMode >::get(), folly::lock(), mutex, folly::ThreadLocalPtr< T, Tag, AccessMode >::reset(), folly::pushmi::detail::t, and Widget::totalVal_.
TEST | ( | ThreadLocal | , |
BasicDestructor | |||
) |
Definition at line 244 of file ThreadLocalTest.cpp.
References EXPECT_EQ, folly::join(), and Widget::totalVal_.
TEST | ( | ThreadLocal | , |
ReallocDestructor | |||
) |
Definition at line 252 of file ThreadLocalTest.cpp.
References folly::join(), and MultiWidget::val_.
TEST | ( | ThreadLocal | , |
SimpleRepeatDestructor | |||
) |
Definition at line 257 of file ThreadLocalTest.cpp.
References EXPECT_EQ, and Widget::totalVal_.
TEST | ( | ThreadLocal | , |
InterleavedDestructors | |||
) |
Definition at line 270 of file ThreadLocalTest.cpp.
References EXPECT_EQ, FOR_EACH_RANGE, g(), i, folly::lock(), mutex, and Widget::totalVal_.
TEST | ( | ThreadLocalPtr | , |
AccessAllThreadsCounter | |||
) |
Definition at line 338 of file ThreadLocalTest.cpp.
References SimpleThreadCachedInt::add(), EXPECT_EQ, i, kNumThreads, fizz::detail::read(), folly::run(), folly::pushmi::detail::t, and threads.
TEST | ( | ThreadLocal | , |
resetNull | |||
) |
Definition at line 373 of file ThreadLocalTest.cpp.
References EXPECT_EQ, folly::ThreadLocal< T, Tag, AccessMode >::get(), and folly::ThreadLocal< T, Tag, AccessMode >::reset().
TEST | ( | ThreadLocal | , |
Movable1 | |||
) |
TEST | ( | ThreadLocal | , |
Movable2 | |||
) |
Definition at line 401 of file ThreadLocalTest.cpp.
References EXPECT_EQ, m, and map().
TEST | ( | ThreadLocal | , |
TCICreateOnThreadExit | |||
) |
Definition at line 438 of file ThreadLocalTest.cpp.
References check(), data_, folly::getCurrentThreadID(), i, folly::join(), uint64_t, v, and val.
TEST | ( | ThreadLocal | , |
Stress | |||
) |
Definition at line 494 of file ThreadLocalTest.cpp.
References folly::ThreadLocal< T, Tag, AccessMode >::accessAllThreads(), ADD_FAILURE, EXPECT_EQ, EXPECT_TRUE, i, k, folly::lock(), mutex, ptr, folly::pushmi::detail::t, folly::TEST(), threads, and folly::value().
TEST | ( | ThreadLocal | , |
Fork2 | |||
) |
Definition at line 632 of file ThreadLocalTest.cpp.
References ADD_FAILURE, EXPECT_EQ, EXPECT_TRUE, folly::ThreadLocal< T, Tag, AccessMode >::get(), and folly::pushmi::detail::t.
TEST | ( | ThreadLocal | , |
DISABLED_SharedLibrary | |||
) |
Definition at line 672 of file ThreadLocalTest.cpp.
References ASSERT_NE, exe, folly::fs::executable_path(), EXPECT_EQ, lib, folly::Baton< MayBlock, Atom >::post(), useA(), and folly::Baton< MayBlock, Atom >::wait().
TEST | ( | ThreadLocal | , |
UnregisterClassHasConstExprCtor | |||
) |
Definition at line 726 of file ThreadLocalTest.cpp.