mirror of
https://github.com/corda/corda.git
synced 2025-01-05 20:54:13 +00:00
add Thread.name field
This commit is contained in:
parent
e1d712ef71
commit
0e539615e7
@ -20,9 +20,11 @@ public class Thread implements Runnable {
|
||||
private boolean interrupted;
|
||||
private Object sleepLock;
|
||||
private ClassLoader classLoader;
|
||||
private String name;
|
||||
|
||||
public Thread(Runnable task) {
|
||||
this.task = task;
|
||||
public Thread(Runnable task, String name) {
|
||||
this(task);
|
||||
this.name = name;
|
||||
|
||||
Thread current = currentThread();
|
||||
|
||||
@ -39,8 +41,8 @@ public class Thread implements Runnable {
|
||||
classLoader = current.classLoader;
|
||||
}
|
||||
|
||||
public Thread(Runnable task, String name) {
|
||||
this(task);
|
||||
public Thread(Runnable task) {
|
||||
this(task, "Thread["+task+"]");
|
||||
}
|
||||
|
||||
public synchronized void start() {
|
||||
@ -118,4 +120,9 @@ public class Thread implements Runnable {
|
||||
public static native int activeCount();
|
||||
|
||||
public static native int enumerate(Thread[] array);
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1847,7 +1847,7 @@ Thread::init()
|
||||
threadPeer(this, javaThread) = reinterpret_cast<jlong>(this);
|
||||
} else {
|
||||
this->javaThread = makeThread
|
||||
(this, reinterpret_cast<int64_t>(this), 0, 0, 0, 0, m->loader);
|
||||
(this, reinterpret_cast<int64_t>(this), 0, 0, 0, 0, m->loader, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user