Change Thread::peer_ to be a jobject instead of an Object*
Fixes issue where GC was freeing the java peer if the parent thread exited before the child thread got registered.
Change-Id: I6fbe74865d5827d243ac55fc396679afa97ff2f9
diff --git a/src/thread.h b/src/thread.h
index 34dfdbd..a58fb65 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -283,7 +283,7 @@
// Sets the thread's name.
void SetThreadName(const char* name) SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
- Object* GetPeer() const SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ jobject GetPeer() const {
return peer_;
}
@@ -702,7 +702,7 @@
Thread* self_;
// Our managed peer (an instance of java.lang.Thread).
- Object* peer_;
+ jobject peer_;
// The "lowest addressable byte" of the stack
byte* stack_begin_;