Index: runtime/bin/thread_openbsd.cc |
diff --git a/runtime/bin/thread_android.cc b/runtime/bin/thread_openbsd.cc |
similarity index 97% |
copy from runtime/bin/thread_android.cc |
copy to runtime/bin/thread_openbsd.cc |
index f84a988b4a33e1763e41815b0c3ec914f0a5094d..40a25d09abdb87ec1fc0270b80d5946754bdedeb 100644 |
--- a/runtime/bin/thread_android.cc |
+++ b/runtime/bin/thread_openbsd.cc |
@@ -3,9 +3,10 @@ |
// BSD-style license that can be found in the LICENSE file. |
#include "platform/globals.h" |
-#if defined(TARGET_OS_ANDROID) |
+#if defined(TARGET_OS_OPENBSD) |
#include "bin/thread.h" |
+#include "bin/thread_openbsd.h" |
#include <errno.h> // NOLINT |
#include <sys/time.h> // NOLINT |
@@ -148,7 +149,7 @@ intptr_t Thread::GetMaxStackSize() { |
ThreadId Thread::GetCurrentThreadId() { |
- return gettid(); |
+ return pthread_self(); |
} |
@@ -159,12 +160,12 @@ bool Thread::Join(ThreadId id) { |
intptr_t Thread::ThreadIdToIntPtr(ThreadId id) { |
ASSERT(sizeof(id) == sizeof(intptr_t)); |
- return static_cast<intptr_t>(id); |
+ return reinterpret_cast<intptr_t>(id); |
} |
bool Thread::Compare(ThreadId a, ThreadId b) { |
- return a == b; |
+ return pthread_equal(a, b) != 0; |
} |
@@ -332,4 +333,4 @@ void Monitor::NotifyAll() { |
} // namespace bin |
} // namespace dart |
-#endif // defined(TARGET_OS_ANDROID) |
+#endif // defined(TARGET_OS_OPENBSD) |