[Commits] 11789a4: MariaRocks: Only call pthread_setname_np on platforms that support it

Sergei Petrunia psergey at askmonty.org
Sun Mar 12 16:39:45 EET 2017


revision-id: 11789a4fbe754c0aeedbc4618ef226f259c2366d
parent(s): a72abc8c30c62e01fc2eae934478176ed02597e9
committer: Sergei Petrunia
branch nick: 10.2-mariarocks
timestamp: 2017-03-12 17:39:45 +0300
message:

MariaRocks: Only call pthread_setname_np on platforms that support it

This is a second such fix, the first was wiped out in a merge.

---
 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 b0bf1ba..a93e4fc 100644
--- a/storage/rocksdb/rdb_threads.h
+++ b/storage/rocksdb/rdb_threads.h
@@ -112,6 +112,7 @@ class Rdb_thread {
       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)
     {
@@ -120,6 +121,7 @@ class Rdb_thread {
           "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