Commit 80031642 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook Github Bot

Use getCurrentThreadName() in EventBaseTestLib.h

Summary: [Folly] Use `getCurrentThreadName()` in `EventBaseTestLib.h` v.s. using pthread directly.

Reviewed By: Orvid

Differential Revision: D19226856

fbshipit-source-id: 90f825ab0fc186a896cd63c425e55153daa0fefd
parent cc6aac41
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <folly/io/async/test/Util.h> #include <folly/io/async/test/Util.h>
#include <folly/portability/Stdlib.h> #include <folly/portability/Stdlib.h>
#include <folly/portability/Unistd.h> #include <folly/portability/Unistd.h>
#include <folly/system/ThreadName.h>
#include <folly/futures/Promise.h> #include <folly/futures/Promise.h>
...@@ -1872,11 +1873,7 @@ TYPED_TEST_P(EventBaseTest, EventBaseThreadName) { ...@@ -1872,11 +1873,7 @@ TYPED_TEST_P(EventBaseTest, EventBaseThreadName) {
base.setName("foo"); base.setName("foo");
base.loop(); base.loop();
#if (__GLIBC__ >= 2) && (__GLIBC_MINOR__ >= 12) ASSERT_EQ("foo", *getCurrentThreadName());
char name[16];
pthread_getname_np(pthread_self(), name, 16);
ASSERT_EQ(0, strcmp("foo", name));
#endif
} }
TYPED_TEST_P(EventBaseTest, RunBeforeLoop) { TYPED_TEST_P(EventBaseTest, RunBeforeLoop) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment