forked from kframework/java-semantics
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathThread.java
More file actions
37 lines (25 loc) · 659 Bytes
/
Thread.java
File metadata and controls
37 lines (25 loc) · 659 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
package java.lang;
public class Thread implements Runnable {
private static int nextTid = 1;
private Runnable runnable;
private int tid = nextTid++;
public Thread() {
this.runnable = this;
}
public Thread(Runnable runnable) {
this.runnable = runnable;
}
public void run() {}
public void start() {
startImpl(tid);
}
private native void startImpl(int tid);
public synchronized void join() throws InterruptedException {
joinImpl(tid);
}
public native void joinImpl(int tid) throws InterruptedException;
public void interrupt() {
interruptImpl(tid);
}
public native void interruptImpl(int tid);
}