Hirdetés
Új hozzászólás Aktív témák
-
btotyi
tag
Például így :
package test;
class Szal extends java.lang.Thread {
volatile static boolean Stop = false;
// Primordial thread executes main()
public static void main(String args[]) throws InterruptedException {
// Create and start 2 threads
Szal thread1 = new Szal();
thread1.setPriority(1); // 1st thread at 1th non-RT priority
Szal thread2 = new Szal();
thread2.setPriority(1); // 2nd thread at 1th non-RT priority
thread1.start(); // start 1st thread to execute run()
thread2.start(); // start 2nd thread to execute run()
// Sleep for 10 seconds, then tell the threads to terminate
Thread.sleep(10 * 1000);
Stop = true;
}
public void run() { // Created threads execute this method
System.out.println(''Created thread'');
int count = 0;
for (; Stop != true;) { // continue until asked to stop
count++;
Thread.yield(); // yield to other thread
}
System.out.println(''Thread terminates. Loop count is '' + count);
}
}
forrás:[link]
Új hozzászólás Aktív témák
A topicot kiemeltem. Valaki nem akar egy nyitó hsz-t írni?:))
- Dell 27" UltraSharp U2713HM QHD 2560x1440 IPS DP/DVI/HDMI/VGA monitor - PIVOT is - több db
- LG SP2 2.1 Soundbar 6 hó garancia, számlával!
- 1db nagyon apró fekete pötty a képen - Eizo EV2450 24" IPS fekete - HDMI - PIVOT - Made in Japan
- Latitude 5450 14" FHD IPS Ultra 5 125U 16GB 256GB NVMe ujjolv IR kam gar
- X1 Yoga 9th 2-in-1 14" FHD+ IPS érintő Ultra 7 165U 16GB 512GB NVMe ujjlolv IR kam gar
- Apple iPhone 13 Pro Max Sierra Blue ProMotion 120 Hz, Pro kamerák 128 GB Használt, szép,100%
- Telefon felvásárlás!! iPhone X/iPhone Xs/iPhone XR/iPhone Xs Max
- HIBÁTLAN iPhone 12 mini 64GB Green -1 ÉV GARANCIA - Kártyafüggetlen, MS3452,100% Akksi
- LG OLED TV 55CS6LA
- Eladó Samsung Galaxy Tab A9 4/64GB / 12 hó jótállás
Állásajánlatok
Cég: ATW Internet Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest


