| 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)
|
|
|