Package Name: java.lang.threadgroup
with java.lang; use java.lang;
with java.lang.Thread; use java.lang.Thread;
with java.lang.Runnable; use java.lang.Runnable;
with java.lang.Throwable; use java.lang.Throwable;
with java.lang.String; use java.lang.String;
package java.lang.ThreadGroup is
type ThreadGroup_Obj is new Object with null record;
type ThreadGroup_Ptr is access all ThreadGroup_Obj'Class;
function new_ThreadGroup(
name : String_Ptr)
return ThreadGroup_Ptr;
function new_ThreadGroup(
parent : ThreadGroup_Ptr;
name : String_Ptr)
return ThreadGroup_Ptr;
function getName(Obj : access ThreadGroup_Obj) return String_Ptr;
function getParent(Obj : access ThreadGroup_Obj) return ThreadGroup_Ptr;
function getMaxPriority(Obj : access ThreadGroup_Obj) return Integer;
function isDaemon(Obj : access ThreadGroup_Obj) return Boolean;
procedure setDaemon(Obj : access ThreadGroup_Obj;
daemon : Boolean);
procedure setMaxPriority(Obj : access ThreadGroup_Obj;
pri : Integer);
function parentOf(Obj : access ThreadGroup_Obj;
g : ThreadGroup_Ptr)
return Boolean;
procedure checkAccess(Obj : access ThreadGroup_Obj);
function activeCount(Obj : access ThreadGroup_Obj) return Integer;
function enumerate(Obj : access ThreadGroup_Obj;
list : Thread.Thread_Array)
return Integer;
function enumerate(Obj : access ThreadGroup_Obj;
list : Thread.Thread_Array;
recurse : Boolean)
return Integer;
function activeGroupCount(Obj : access ThreadGroup_Obj) return Integer;
type ThreadGroup_Array is array(Positive range <>) of ThreadGroup_Ptr;
function enumerate(Obj : access ThreadGroup_Obj;
list : ThreadGroup_Array)
return Integer;
function enumerate(Obj : access ThreadGroup_Obj;
list : ThreadGroup_Array;
recurse : Boolean)
return Integer;
procedure stop(Obj : access ThreadGroup_Obj);
procedure suspend(Obj : access ThreadGroup_Obj);
procedure resume(Obj : access ThreadGroup_Obj);
procedure destroy(Obj : access ThreadGroup_Obj);
procedure list(Obj : access ThreadGroup_Obj);
procedure uncaughtException(Obj : access ThreadGroup_Obj;
t : Thread_Ptr;
e : Throwable_Ptr);
function toString(Obj : access ThreadGroup_Obj) return String_Ptr;
pragma Import(Java, setDaemon);
pragma Import(Java, getParent);
pragma Import(Java, destroy);
pragma Import(Java, isDaemon);
pragma Import(Java, getName);
pragma Import(Java, suspend);
pragma Import(Java, uncaughtException);
pragma Import(Java, enumerate);
pragma Import(Java, getMaxPriority);
pragma Import(Java, checkAccess);
pragma Import(Java, parentOf);
pragma Import(Java, activeGroupCount);
pragma Import(Java, stop);
pragma Import(Java, list);
pragma Import(Java, resume);
pragma Import(Java, toString);
pragma Import(Java, setMaxPriority);
pragma Import(Java, activeCount);
pragma Import(Java_Constructor, new_ThreadGroup);
-- The following are constructors for Threads
-- NOTE: these need to be here, so ThreadGroup_Ptr is fully defined.
function new_Thread(
group : ThreadGroup_Ptr;
target : Runnable_Ptr)
return Thread_Ptr;
function new_Thread(
group : ThreadGroup_Ptr;
name : String_Ptr)
return Thread_Ptr;
function new_Thread(
group : ThreadGroup_Ptr;
target : Runnable_Ptr;
name : String_Ptr)
return Thread_Ptr;
-- This is actually a Thread method:
function getThreadGroup(Obj : access Thread_Obj) return ThreadGroup_Ptr;
pragma Import(Java, getThreadGroup, "java/lang/Thread.getThreadGroup");
pragma Import(Java_Constructor, new_Thread, "java/lang/Thread.");
end java.lang.ThreadGroup;