From: Christopher Dykes Date: Wed, 3 May 2017 14:43:46 +0000 (-0700) Subject: Fix compiling with PThread support on Windows... Again... X-Git-Tag: v2017.05.08.00~20 X-Git-Url: http://plrg.eecs.uci.edu/git/?p=folly.git;a=commitdiff_plain;h=58a70372d16f13a952ecc046fa90ce055fb6f36a;ds=sidebyside Fix compiling with PThread support on Windows... Again... Summary: I was bad and didn't follow through on my previous test plan, and so didn't check that it completely fixed the issue, instead only fixing one of the two problems. This fixes the other one. Reviewed By: yfeldblum Differential Revision: D4988408 fbshipit-source-id: 44389bc67bcb7d6db984075f3600948460fa8c5a --- diff --git a/folly/ThreadName.cpp b/folly/ThreadName.cpp index 3e2d9aab..a24a6b8b 100644 --- a/folly/ThreadName.cpp +++ b/folly/ThreadName.cpp @@ -90,6 +90,10 @@ bool setThreadName(std::thread::id tid, StringPiece name) { #if FOLLY_HAVE_PTHREAD bool setThreadName(pthread_t pid, StringPiece name) { +#if _WIN32 + // Not currently supported on Windows. + return false; +#else static_assert( std::is_same::value, "This assumes that the native handle type is pthread_t"); @@ -103,6 +107,7 @@ bool setThreadName(pthread_t pid, StringPiece name) { std::thread::id id; std::memcpy(&id, &pid, sizeof(id)); return setThreadName(id, name); +#endif } #endif