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

Unified Diff: runtime/vm/thread_interrupter_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/vm/signal_handler_openbsd.cc ('k') | runtime/vm/virtual_memory_openbsd.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_interrupter_openbsd.cc
diff --git a/runtime/vm/thread_interrupter_linux.cc b/runtime/vm/thread_interrupter_openbsd.cc
similarity index 82%
copy from runtime/vm/thread_interrupter_linux.cc
copy to runtime/vm/thread_interrupter_openbsd.cc
index 28ec681fa555813ee343a7c5bbb95be5cd05925a..f5042362d24f5b05c72224638c1c6a007fae44a6 100644
--- a/runtime/vm/thread_interrupter_linux.cc
+++ b/runtime/vm/thread_interrupter_openbsd.cc
@@ -3,9 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
#include "platform/globals.h"
-#if defined(TARGET_OS_LINUX)
+#if defined(TARGET_OS_OPENBSD)
-#include <errno.h> // NOLINT
+#include <errno.h>
#include "vm/flags.h"
#include "vm/os.h"
@@ -18,7 +18,7 @@ namespace dart {
DECLARE_FLAG(bool, thread_interrupter);
DECLARE_FLAG(bool, trace_thread_interrupter);
-class ThreadInterrupterLinux : public AllStatic {
+class ThreadInterrupterOpenBSD : public AllStatic {
public:
static void ThreadInterruptSignalHandler(int signal, siginfo_t* info,
void* context_) {
@@ -30,8 +30,7 @@ class ThreadInterrupterLinux : public AllStatic {
return;
}
// Extract thread state.
- ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
- mcontext_t mcontext = context->uc_mcontext;
+ mcontext_t mcontext = reinterpret_cast<mcontext_t &>(context_);
InterruptedThreadState its;
its.pc = SignalHandler::GetProgramCounter(mcontext);
its.fp = SignalHandler::GetFramePointer(mcontext);
@@ -42,7 +41,6 @@ class ThreadInterrupterLinux : public AllStatic {
}
};
-
void ThreadInterrupter::InterruptThread(OSThread* thread) {
if (FLAG_trace_thread_interrupter) {
OS::Print("ThreadInterrupter interrupting %p\n",
@@ -54,7 +52,8 @@ void ThreadInterrupter::InterruptThread(OSThread* thread) {
void ThreadInterrupter::InstallSignalHandler() {
- SignalHandler::Install(ThreadInterrupterLinux::ThreadInterruptSignalHandler);
+ SignalHandler::Install(ThreadInterrupterOpenBSD::
+ ThreadInterruptSignalHandler);
}
@@ -65,4 +64,4 @@ void ThreadInterrupter::RemoveSignalHandler() {
} // namespace dart
-#endif // defined(TARGET_OS_LINUX)
+#endif // defined(TARGET_OS_OPENBSD)
« no previous file with comments | « runtime/vm/signal_handler_openbsd.cc ('k') | runtime/vm/virtual_memory_openbsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698