[Openmp-commits] [PATCH] D59451: Fix gettid warnings and one test on FreeBSD

Dimitry Andric via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Mar 16 08:25:13 PDT 2019


dim updated this revision to Diff 190963.
dim added a comment.

Update to use `-pthread` instead.


Repository:
  rOMP OpenMP

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

https://reviews.llvm.org/D59451

Files:
  runtime/src/kmp_wrapper_getpid.h
  runtime/test/ompt/misc/interoperability.cpp


Index: runtime/test/ompt/misc/interoperability.cpp
===================================================================
--- runtime/test/ompt/misc/interoperability.cpp
+++ runtime/test/ompt/misc/interoperability.cpp
@@ -1,9 +1,9 @@
-// RUN: %libomp-cxx-compile-and-run | %sort-threads | FileCheck %s
+// RUN: %libomp-cxx-compile -pthread && %libomp-run | %sort-threads | FileCheck %s
 // REQUIRES: ompt
 
 #include <iostream>
 #include <thread>
-#if !defined(__NetBSD__)
+#if !defined(__FreeBSD__) && !defined(__NetBSD__)
 #include <alloca.h>
 #else
 #include <cstdlib>
Index: runtime/src/kmp_wrapper_getpid.h
===================================================================
--- runtime/src/kmp_wrapper_getpid.h
+++ runtime/src/kmp_wrapper_getpid.h
@@ -23,6 +23,9 @@
 #if KMP_OS_DARWIN
 // OS X
 #define __kmp_gettid() syscall(SYS_thread_selfid)
+#elif KMP_OS_FREEBSD
+#include <pthread_np.h>
+#define __kmp_gettid() pthread_getthreadid_np()
 #elif KMP_OS_NETBSD
 #include <lwp.h>
 #define __kmp_gettid() _lwp_self()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59451.190963.patch
Type: text/x-patch
Size: 1019 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190316/4c686e41/attachment.bin>


More information about the Openmp-commits mailing list