mirror of
https://github.com/corda/corda.git
synced 2025-01-08 14:03:06 +00:00
put thread into runnable state in Thread.start
This commit is contained in:
parent
28b5c46a0b
commit
d868815737
@ -86,8 +86,11 @@ public class Thread implements Runnable {
|
|||||||
throw new IllegalStateException("thread already started");
|
throw new IllegalStateException("thread already started");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
state = (byte) State.RUNNABLE.ordinal();
|
||||||
|
|
||||||
peer = doStart();
|
peer = doStart();
|
||||||
if (peer == 0) {
|
if (peer == 0) {
|
||||||
|
state = (byte) State.NEW.ordinal();
|
||||||
throw new RuntimeException("unable to start native thread");
|
throw new RuntimeException("unable to start native thread");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -95,7 +98,6 @@ public class Thread implements Runnable {
|
|||||||
private native long doStart();
|
private native long doStart();
|
||||||
|
|
||||||
private static void run(Thread t) throws Throwable {
|
private static void run(Thread t) throws Throwable {
|
||||||
t.state = (byte) State.RUNNABLE.ordinal();
|
|
||||||
try {
|
try {
|
||||||
t.run();
|
t.run();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
Loading…
Reference in New Issue
Block a user