mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-22 16:14:10 -08:00
Merge pull request #63 from shannah/fix_thread_run
Fixed issue with running threads that don't explicitly include a runnabl...
This commit is contained in:
commit
736746724a
|
@ -35,6 +35,7 @@ public class TThread extends TObject implements TRunnable {
|
|||
private static long nextId = 1;
|
||||
private static int activeCount = 1;
|
||||
private long id;
|
||||
private int priority = 0;
|
||||
|
||||
private TString name;
|
||||
TRunnable target;
|
||||
|
@ -64,7 +65,7 @@ public class TThread extends TObject implements TRunnable {
|
|||
try {
|
||||
activeCount++;
|
||||
setCurrentThread(TThread.this);
|
||||
target.run();
|
||||
TThread.this.run();
|
||||
} finally {
|
||||
activeCount--;
|
||||
setCurrentThread(mainThread);
|
||||
|
@ -138,4 +139,12 @@ public class TThread extends TObject implements TRunnable {
|
|||
}, millis);
|
||||
}
|
||||
|
||||
public final void setPriority(int newPriority){
|
||||
this.priority = newPriority;
|
||||
}
|
||||
|
||||
public final int getPriority(){
|
||||
return this.priority;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user