Skip to content

Commit

Permalink
Suspend threads when installing instrumentation
Browse files Browse the repository at this point in the history
  • Loading branch information
rovo89 committed Dec 10, 2017
1 parent 4b9a7a6 commit a8ab899
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions libxposed_art.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ void XposedBridge_invalidateCallersNative(JNIEnv* env, jclass, jobjectArray java
}

// Now instrument the stack to deoptimize methods which are being called right now.
ScopedThreadSuspension sts(soa.Self(), kSuspended);
ScopedSuspendAll ssa(__FUNCTION__);
MutexLock mu(soa.Self(), *Locks::thread_list_lock_);
runtime->GetThreadList()->ForEach([](Thread* thread, void*) SHARED_REQUIRES(Locks::mutator_lock_) {
Runtime::Current()->GetInstrumentation()->InstrumentThreadStack(thread);
Expand Down
2 changes: 1 addition & 1 deletion xposed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ bool shouldIgnoreCommand(int argc, const char* const argv[]) {
if (mightBeSuperuser && strcmp(argv[i], "--user") == 0)
return true;

char* lastComponent = strrchr(argv[i], '.');
const char* lastComponent = strrchr(argv[i], '.');
if (!lastComponent)
continue;

Expand Down

0 comments on commit a8ab899

Please sign in to comment.