30 using namespace folly;
43 static constexpr
StringPiece kThreadName{
"named_example"};
55 if (createdThreadName) {
64 auto ebm_eb =
static_cast<EventBase*
>(
nullptr);
66 EXPECT_EQ(uintptr_t(sebt_eb), uintptr_t(ebm_eb));
73 auto ebm_eb =
static_cast<EventBase*
>(
nullptr);
75 EXPECT_EQ(uintptr_t(sebt_eb), uintptr_t(ebm_eb));
82 EXPECT_NE(this_thread::get_id(), io_thread_id) <<
"sanity";
85 thread::id eb_dtor_thread_id;
87 [&] { eb_dtor_thread_id = this_thread::get_id(); }));
89 EXPECT_EQ(io_thread_id, eb_dtor_thread_id);
EventBase * getEventBase() const
EventBase * getEventBase() const
#define ASSERT_EQ(val1, val2)
bool runInEventBaseThreadAndWait(void(*fn)(T *), T *arg)
#define EXPECT_EQ(val1, val2)
—— Concurrent Priority Queue Implementation ——
FOLLY_ALWAYS_INLINE bool try_wait_for(const std::chrono::duration< Rep, Period > &timeout, const WaitOptions &opt=wait_options()) noexcept
bool runInEventBaseThread(void(*fn)(T *), T *arg)
std::thread::id getThreadId() const
Value & emplace(Args &&...args)
TEST_F(ScopedEventBaseThreadTest, example)
#define EXPECT_NE(val1, val2)
FOLLY_CPP14_CONSTEXPR const Value & value() const &
void runOnDestruction(LoopCallback *callback)
Optional< std::string > getCurrentThreadName()
PUSHMI_INLINE_VAR constexpr detail::get_fn< T > get
#define ASSERT_TRUE(condition)