Set background thread name

This commit is contained in:
Vinnie Falco
2013-11-22 14:49:56 -08:00
parent fad52c5917
commit 21918922f4

View File

@@ -1364,6 +1364,11 @@ class PosixEnv : public Env {
}
static void* BGThreadWrapper(void* arg) {
#if (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012
pthread_setname_np (pthread_self(), "rocksdb:bg");
#else
prctl (PR_SET_NAME, "rocksdb:bg", 0, 0, 0);
#endif
reinterpret_cast<ThreadPool*>(arg)->BGThread();
return nullptr;
}