()
| 83 | } |
| 84 | |
| 85 | public synchronized void start() { |
| 86 | if (peer != 0) { |
| 87 | throw new IllegalStateException("thread already started"); |
| 88 | } |
| 89 | |
| 90 | state = (byte) State.RUNNABLE.ordinal(); |
| 91 | |
| 92 | peer = doStart(); |
| 93 | if (peer == 0) { |
| 94 | state = (byte) State.NEW.ordinal(); |
| 95 | throw new RuntimeException("unable to start native thread"); |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | private native long doStart(); |
| 100 |