blob: b511c3238856eae211b1afc5d37d550f379094e2 [file] [log] [blame]
#include "VMStaticInstance.h"
#include <stdlib.h>
extern "C" {
JNIEXPORT void JNICALL Java_sun_misc_Unsafe_unpark(
JavaObject* unsafe, JavaObject* thread) {
llvm_gcroot(unsafe, 0);
llvm_gcroot(thread, 0);
Jnjvm* vm = JavaThread::get()->getJVM();
JavaField * field = vm->upcalls->eetop;
// Get the eetop field
// It's possible that the thread to be interrupted has not finished
// its initialization. Wait until the initialization is done.
while (field->getInstanceLongField(thread) == 0)
vmkit::Thread::yield();
JavaThread* jth = (JavaThread*)field->getInstanceLongField(thread);
jth->parkLock.unpark();
}
}