Ú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?:))
- MW2 - MW3 játékosok baráti köre
- Beszállna az árnövelő versenybe az AMD
- PlayStation 5
- A fociról könnyedén, egy baráti társaságban
- Házi hangfal építés
- Xbox Series X|S
- AMD Ryzen 9 / 7 / 5 9***(X) "Zen 5" (AM5)
- Audi, Cupra, Seat, Skoda, Volkswagen topik
- Folyószámla, bankszámla, bankváltás, külföldi kártyahasználat
- EA Sports WRC '23
- További aktív témák...
- HP Omen 15 ( i7 6th, 8 GB, 240 SSD, 4GB Gef960) AkciÓÓ!
- Logitech MX Keys Mini for Mac - német - bontatlan
- 15.gen! Intel Core ULTRA 9 285K (24mag!) +32GB DDR5 kit +ASROCK Z890 PRO-A! GAR/SZÁMLA (Te nevedre)!
- ASUS TUF Gaming GeForce RTX 3080 10GB OC GDDR6X 320bit LHR dobozos, 1 tulajos, 2027.07.04-ig gari
- Intel D3-S4510 1,92 TB - 2,5", SATA3, 7100 TBW - 100/99% - Eladó!
- Keresünk iPhone 13/13 Mini/13 Pro/13 Pro Max
- REFURBISHED és ÚJ - HP USB-C/A Universal Dock G2 (5TW13AA) (DisplayLink)
- Samsung Gear VR: Note5, S6 (EDGE), S7 (EDGE)
- AKCIÓ! Intel Core i9 13900KS 24 mag 32 szál processzor garanciával hibátlan működéssel
- LG UltraGear 32GS95UX-B OLED Monitor! 32" 3840x2160 / 480Hz / 0.03ms / FreeSync / G-Sync! BeszámítOK
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest

