Implement monitors.
Change-Id: Ifc7a801f9cbcdfbc1e1af5c905261dfadaa60f45
diff --git a/src/object.cc b/src/object.cc
index b5e66d9..1e0d5c6 100644
--- a/src/object.cc
+++ b/src/object.cc
@@ -17,6 +17,7 @@
#include "dex_cache.h"
#include "dex_file.h"
#include "runtime.h"
+#include "sync.h"
namespace art {
@@ -25,6 +26,30 @@
return GetClass() == GetClass()->GetDescriptor()->GetClass();
}
+uint32_t Object::GetLockOwner() {
+ return Monitor::GetLockOwner(monitor_);
+}
+
+void Object::MonitorEnter(Thread* thread) {
+ Monitor::MonitorEnter(thread, this);
+}
+
+void Object::MonitorExit(Thread* thread) {
+ Monitor::MonitorExit(thread, this);
+}
+
+void Object::Notify() {
+ Monitor::Notify(Thread::Current(), this);
+}
+
+void Object::NotifyAll() {
+ Monitor::NotifyAll(Thread::Current(), this);
+}
+
+void Object::Wait(int64_t ms, int32_t ns) {
+ Monitor::Wait(Thread::Current(), this, ms, ns, true);
+}
+
// TODO: get global references for these
Class* Field::java_lang_reflect_Field_ = NULL;