Commit 766b616c authored by Adam Simpkins's avatar Adam Simpkins Committed by Facebook Github Bot

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
parent 103ad3da
......@@ -18,6 +18,7 @@
#include <folly/Exception.h>
#include <folly/FileUtil.h>
#include <folly/experimental/logging/LoggerDB.h>
#include <folly/system/ThreadName.h>
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
......
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