moved yield examples from core-java-concurrency-advanced to core-java-concurrency-advanced-2

This commit is contained in:
fejera
2019-09-29 11:19:56 +02:00
parent 0bfbfffac1
commit 735462e6a8
3 changed files with 1 additions and 1 deletions

View File

@@ -1,17 +0,0 @@
package com.baeldung.concurrent.yield;
public class ThreadYield {
public static void main(String[] args) {
Runnable r = () -> {
int counter = 0;
while (counter < 2) {
System.out.println(Thread.currentThread()
.getName());
counter++;
Thread.yield();
}
};
new Thread(r).start();
new Thread(r).start();
}
}