implement JavaVM::AttachCurrentThreadAsDaemon

This commit is contained in:
Joel Dice 2009-11-03 14:52:14 -07:00
parent 4566e7a7dd
commit 82d2be8e71

View File

@ -41,6 +41,19 @@ AttachCurrentThread(Machine* m, Thread** t, void*)
return 0;
}
jint JNICALL
AttachCurrentThreadAsDaemon(Machine* m, Thread** t, void* parameters)
{
*t = static_cast<Thread*>(m->localThread->get());
if (*t == 0) {
AttachCurrentThread(m, t, parameters);
ENTER(*t, Thread::ActiveState);
setDaemon(*t, (*t)->javaThread, true);
}
return 0;
}
jint JNICALL
DetachCurrentThread(Machine* m)
{
@ -1902,6 +1915,7 @@ populateJNITables(JavaVMVTable* vmTable, JNIEnvVTable* envTable)
vmTable->DestroyJavaVM = DestroyJavaVM;
vmTable->AttachCurrentThread = AttachCurrentThread;
vmTable->AttachCurrentThreadAsDaemon = AttachCurrentThreadAsDaemon;
vmTable->DetachCurrentThread = DetachCurrentThread;
vmTable->GetEnv = GetEnv;