re PR libgcj/27730 (Thread.getId() needs implemented)
PR libgcj/27730: * java/lang/Thread.java (threadId): New field. (nextThreadId): New static field. (Thread): Initialize new field. (getId): New method. From-SVN: r114524
This commit is contained in:
parent
0cf32584ca
commit
45559ef181
2 changed files with 32 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2006-06-09 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
PR libgcj/27730:
|
||||||
|
* java/lang/Thread.java (threadId): New field.
|
||||||
|
(nextThreadId): New static field.
|
||||||
|
(Thread): Initialize new field.
|
||||||
|
(getId): New method.
|
||||||
|
|
||||||
2006-06-09 Tom Tromey <tromey@redhat.com>
|
2006-06-09 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* java/lang/Class.java (getClassLoaderInternal): Now native.
|
* java/lang/Class.java (getClassLoaderInternal): Now native.
|
||||||
|
|
|
@ -127,6 +127,12 @@ public class Thread implements Runnable
|
||||||
/** The context classloader for this Thread. */
|
/** The context classloader for this Thread. */
|
||||||
private ClassLoader contextClassLoader;
|
private ClassLoader contextClassLoader;
|
||||||
|
|
||||||
|
/** This thread's ID. */
|
||||||
|
private final long threadId;
|
||||||
|
|
||||||
|
/** The next thread ID to use. */
|
||||||
|
private static long nextThreadId;
|
||||||
|
|
||||||
/** The default exception handler. */
|
/** The default exception handler. */
|
||||||
private static UncaughtExceptionHandler defaultHandler;
|
private static UncaughtExceptionHandler defaultHandler;
|
||||||
|
|
||||||
|
@ -354,12 +360,17 @@ public class Thread implements Runnable
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
group = g;
|
group = g;
|
||||||
|
|
||||||
data = null;
|
data = null;
|
||||||
interrupt_flag = false;
|
interrupt_flag = false;
|
||||||
alive_flag = false;
|
alive_flag = false;
|
||||||
startable_flag = true;
|
startable_flag = true;
|
||||||
|
|
||||||
|
synchronized (Thread.class)
|
||||||
|
{
|
||||||
|
this.threadId = nextThreadId++;
|
||||||
|
}
|
||||||
|
|
||||||
if (current != null)
|
if (current != null)
|
||||||
{
|
{
|
||||||
group.checkAccess();
|
group.checkAccess();
|
||||||
|
@ -1027,6 +1038,18 @@ public class Thread implements Runnable
|
||||||
return defaultHandler;
|
return defaultHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the unique identifier for this thread. This ID is generated
|
||||||
|
* on thread creation, and may be re-used on its death.
|
||||||
|
*
|
||||||
|
* @return a positive long number representing the thread's ID.
|
||||||
|
* @since 1.5
|
||||||
|
*/
|
||||||
|
public long getId()
|
||||||
|
{
|
||||||
|
return threadId;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* This interface is used to handle uncaught exceptions
|
* This interface is used to handle uncaught exceptions
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue