add support for starting new threads

This commit is contained in:
Andreas Gal 2014-07-20 16:27:24 -07:00
Родитель edb7c1af53
Коммит 23557e71ee
1 изменённых файлов: 7 добавлений и 1 удалений

Просмотреть файл

@ -214,7 +214,13 @@ Native.prototype["java/lang/Thread.currentThread.()Ljava/lang/Thread;"] = functi
Native.prototype["java/lang/Thread.setPriority0.(II)V"] = function(thread, oldPriority, newPriority) {
}
Native.prototype["java/lang/Thread.start0.()V"] = function() {
Native.prototype["java/lang/Thread.start0.()V"] = function(thread) {
if (thread === CLASSES.mainThread || thread.running)
throw CLASSES.newException(frame.getThread(), "java/lang/IllegalThreadStateException");
var run = CLASSES.getMethod(thread.class, "run", "()V", false, true);
window.setZeroTimeout(function () {
VM.invoke(thread, run, [thread]);
});
}
Native.prototype["com/sun/cldchi/io/ConsoleOutputStream.write.(I)V"] = (function() {