Skip to content

Instantly share code, notes, and snippets.

View thiru-apps's full-sized avatar
🎯
Focusing

Thirunavukkarasu Dhanushkodi thiru-apps

🎯
Focusing
View GitHub Profile
Runnable runnable = () -> {
IntStream.rangeClosed(1, 10).forEach(x -> System.out.println(x));
};
var virtualThread = Thread.ofVirtual().start(runnable);
/** If don't want to start immediately */
var vtYetToStart = Thread.ofVirtual().unstarted(runnable);
/** To start the unstarted thread */