aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/lang/natThread.cc
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/lang/natThread.cc')
-rw-r--r--libjava/java/lang/natThread.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/libjava/java/lang/natThread.cc b/libjava/java/lang/natThread.cc
index 4c0d978..7fe8fb0 100644
--- a/libjava/java/lang/natThread.cc
+++ b/libjava/java/lang/natThread.cc
@@ -1,6 +1,6 @@
// natThread.cc - Native part of Thread class.
-/* Copyright (C) 1998, 1999, 2000, 2001 Free Software Foundation
+/* Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation
This file is part of libgcj.
@@ -410,6 +410,21 @@ _Jv_AttachCurrentThread(jstring name, java::lang::ThreadGroup* group)
return thread;
}
+java::lang::Thread*
+_Jv_AttachCurrentThreadAsDaemon(jstring name, java::lang::ThreadGroup* group)
+{
+ java::lang::Thread *thread = _Jv_ThreadCurrent ();
+ if (thread != NULL)
+ return thread;
+ if (name == NULL)
+ name = java::lang::Thread::gen_name ();
+ thread = new java::lang::Thread (NULL, group, NULL, name);
+ thread->setDaemon (true);
+ _Jv_AttachCurrentThread (thread);
+ _Jv_NotifyThreadStart (thread);
+ return thread;
+}
+
jint
_Jv_DetachCurrentThread (void)
{