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

Unified Diff: runtime/vm/thread_interrupter_android.cc

Issue 254383003: Small fixes for Android. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 8 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
« runtime/bin/socket_android.cc ('K') | « runtime/vm/signal_handler_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/thread_interrupter_android.cc
===================================================================
--- runtime/vm/thread_interrupter_android.cc (revision 35316)
+++ runtime/vm/thread_interrupter_android.cc (working copy)
@@ -5,6 +5,8 @@
#include "platform/globals.h"
#if defined(TARGET_OS_ANDROID)
+#include <sys/syscall.h> // NOLINT
+
#include "vm/signal_handler.h"
#include "vm/thread_interrupter.h"
@@ -26,6 +28,15 @@
return;
}
ASSERT(Thread::Compare(state->id, Thread::GetCurrentThreadId()));
+ // Extract thread state.
+ ucontext_t* context = reinterpret_cast<ucontext_t*>(context_);
+ mcontext_t mcontext = context->uc_mcontext;
+ InterruptedThreadState its;
+ its.tid = state->id;
+ its.pc = SignalHandler::GetProgramCounter(mcontext);
+ its.fp = SignalHandler::GetFramePointer(mcontext);
+ its.sp = SignalHandler::GetStackPointer(mcontext);
+ state->callback(its, state->data);
}
};
@@ -35,7 +46,7 @@
OS::Print("ThreadInterrupter interrupting %p\n",
reinterpret_cast<void*>(state->id));
}
- pthread_kill(state->id, SIGPROF);
+ syscall(__NR_tgkill, getpid(), state->id, SIGPROF);
}
« runtime/bin/socket_android.cc ('K') | « runtime/vm/signal_handler_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698