[libcxx-commits] [PATCH] D119966: [SystemZ][z/OS] Add OPEN_THREAD version of pthread function call

Abhina Sree via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 17 04:25:06 PST 2022


abhina.sreeskantharajan updated this revision to Diff 409586.
abhina.sreeskantharajan added a comment.

formatting


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D119966/new/

https://reviews.llvm.org/D119966

Files:
  libcxx/include/__threading_support


Index: libcxx/include/__threading_support
===================================================================
--- libcxx/include/__threading_support
+++ libcxx/include/__threading_support
@@ -420,7 +420,13 @@
 _LIBCPP_HIDE_FROM_ABI inline
 int __libcpp_thread_detach(__libcpp_thread_t *__t)
 {
+#if !defined(__MVS__) || defined( __SUSV3_THR)
   return pthread_detach(*__t);
+#elif defined(_OPEN_THREADS)
+  return pthread_detach(__t);
+#else
+  #error pthread_detach function is not available
+#endif
 }
 
 _LIBCPP_HIDE_FROM_ABI inline
@@ -446,7 +452,13 @@
 _LIBCPP_HIDE_FROM_ABI inline
 void *__libcpp_tls_get(__libcpp_tls_key __key)
 {
+#if !defined(__MVS__) || defined( __SUSV3_THR)
   return pthread_getspecific(__key);
+#elif defined(_OPEN_THREADS)
+  return pthread_getspecific_d8_np(__key);
+#else
+  #error pthread_getspecific function is not available
+#endif
 }
 
 _LIBCPP_HIDE_FROM_ABI inline


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D119966.409586.patch
Type: text/x-patch
Size: 904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220217/89869463/attachment.bin>


More information about the libcxx-commits mailing list