mirkosertic / Bytecoder

Framework to interpret and transpile JVM bytecode to JavaScript, OpenCL or WebAssembly.

Home Page:https://www.mirkosertic.de/blog/2017/06/compiling-bytecode-to-javascript/

Repository from Github https://github.commirkosertic/BytecoderRepository from Github https://github.commirkosertic/Bytecoder

Multi-threading can compile successfully, but only the data of one thread is printed out in the browser's js

rayowang opened this issue · comments

My code is as follows:

`package testjavawasm;

import java.lang.Thread;

public class TestThread {
public static void main(String[] args) {
//System.out.println("main thread id is: " + Thread.currentThread().getId());

    Thread t1 = new MyThread("thread 1");
    t1.start();

    Thread t2 = new MyThread("thread 2");
    t2.run();
}

}

class MyThread extends Thread{
private String name;

public MyThread(String name) {
    this.name = name;
}

@Override
public void run() {
    for (int i = 0; i < 3; i++) {
        System.out.println(i);
    }
    //System.out.println( name + "id is:" + Thread.currentThread().getId());
}

}`

Fix merged to master branch.