static void joinThreadUninterruptible(Thread thread) {
        boolean interrupted = false;
        while(true) {
            try {
                thread.join();
            } catch(InterruptedException e) {
                interrupted = true;
                continue;
            }
            break;
        }

        if(interrupted)
            Thread.currentThread().interrupt();
    }