[Commits] 4bf4713: pthread_setname_np is available only on linux, so call it only there.

Sergei Petrunia psergey at askmonty.org
Sun Mar 12 22:12:53 EET 2017


revision-id: 4bf47131026483c4ca91cf6bb5d527cd956b890d
parent(s): ba00e640f658ad8d0a4dff09a497a51b8a4de935
committer: Sergei Petrunia
branch nick: mysql-5.6-rocksdb-compile-fixes-to-upstream
timestamp: 2017-03-12 23:12:53 +0300
message:

pthread_setname_np is available only on linux, so call it only there.

---
 storage/rocksdb/rdb_threads.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/storage/rocksdb/rdb_threads.h b/storage/rocksdb/rdb_threads.h
index e5cbb52..876ff56 100644
--- a/storage/rocksdb/rdb_threads.h
+++ b/storage/rocksdb/rdb_threads.h
@@ -81,6 +81,7 @@ public:
       pthread_setname_np resolves the issue.
     */
     DBUG_ASSERT(!m_name.empty());
+#ifdef __linux__
     int err = pthread_setname_np(m_handle, m_name.c_str());
     if (err)
     {
@@ -89,6 +90,7 @@ public:
           "MyRocks: Failed to set name (%s) for current thread, errno=%d",
           m_name.c_str(), errno);
     }
+#endif
   }
 
   void uninit();


More information about the commits mailing list