From: Adam Simpkins Date: Tue, 7 Nov 2017 20:11:23 +0000 (-0800) Subject: logging: set the thread name for the AsyncFileWriter thread X-Git-Tag: v2017.11.13.00~24 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=766b616c0d104cfb37a2ad13284d320f2a4db67a;p=folly.git logging: set the thread name for the AsyncFileWriter thread Summary: AsyncFileWriter uses a separate thread to write messages to the file descriptor. This diff makes us call setThreadName() to set the name of this thread to `log_writer`. Reviewed By: bolinfest Differential Revision: D6238229 fbshipit-source-id: 9c93d80e7ac989e03bc3160bb2f135d67e15c8be --- diff --git a/folly/experimental/logging/AsyncFileWriter.cpp b/folly/experimental/logging/AsyncFileWriter.cpp index e76c73a6..fbd06415 100644 --- a/folly/experimental/logging/AsyncFileWriter.cpp +++ b/folly/experimental/logging/AsyncFileWriter.cpp @@ -18,6 +18,7 @@ #include #include #include +#include using folly::File; using folly::StringPiece; @@ -80,6 +81,8 @@ void AsyncFileWriter::flush() { } void AsyncFileWriter::ioThread() { + folly::setThreadName("log_writer"); + while (true) { // With the lock held, grab a pointer to the current queue, then increment // the ioThreadCounter index so that other threads will write into the