Thread suspension.
Includes SuspendAll/ResumeAll, and uses them in Heap and SignalCatcher.
Change-Id: Ie39b868ca5961f5016f367acade5071392bb723e
diff --git a/src/thread.h b/src/thread.h
index 0d79019..8539962 100644
--- a/src/thread.h
+++ b/src/thread.h
@@ -1,4 +1,18 @@
-// Copyright 2011 Google Inc. All Rights Reserved.
+/*
+ * Copyright (C) 2011 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
#ifndef ART_SRC_THREAD_H_
#define ART_SRC_THREAD_H_
@@ -241,11 +255,9 @@
return state_;
}
- State SetState(State new_state) {
- State old_state = state_;
- state_ = new_state;
- return old_state;
- }
+ State SetState(State new_state);
+
+ void WaitUntilSuspended();
/*
* Changes the priority of this thread to match that of the java.lang.Thread object.
@@ -335,12 +347,6 @@
void SetName(const char* name);
- void Suspend();
-
- bool IsSuspended();
-
- void Resume();
-
static void Startup();
static void Shutdown();
@@ -380,10 +386,6 @@
suspend_count_entry_point_ = handler;
}
- // Increasing the suspend count, will cause the thread to run to safepoint
- void IncrementSuspendCount() { suspend_count_++; }
- void DecrementSuspendCount() { suspend_count_--; }
-
// Linked list recording transitions from native to managed code
void PushNativeToManagedRecord(NativeToManagedRecord* record) {
record->last_top_of_managed_stack = reinterpret_cast<void*>(top_of_managed_stack_.GetSP());