Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(425)

Unified Diff: runtime/bin/thread_openbsd.cc

Issue 1559053002: Refs #10260 OpenBSD support #25327 Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address code review issues Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/bin/thread_openbsd.h ('k') | runtime/bin/utils_openbsd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)
« no previous file with comments | « runtime/bin/thread_openbsd.h ('k') | runtime/bin/utils_openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698