2wenty1ne 2025-01-14 02:17:16 +01:00
commit 9cd6b547d9
3 changed files with 45 additions and 0 deletions

View File

@ -0,0 +1,20 @@
public class Barrier extends Thread{
public boolean stopped = false;
@Override
public void run() {
while(!this.stopped) {
//System.out.println("Running!");
}
}
public static void main(String[] args) throws InterruptedException {
var thread = new Barrier();
thread.start();
Thread.sleep(1000);
thread.stopped = true;
thread.join();
System.out.println("Done!");
}
}

View File

@ -0,0 +1,12 @@
//public class Task extends Thread {
// public Task() {
// this.start();
// }
//
// @Override
// public void run() {
// while (true) {
// System.out.println("Running");
// }
// }
//}

View File

@ -0,0 +1,13 @@
public class Titel {
Titel lock = null;
public synchronized void verb() {
synchronized (lock) {
}
}
public synchronized void nomen() {
}
}