The forums are currently locked and only available for read only access
xlife
Hi, nice to meet you!
Medlem
Forum Posts: 1
Member Since:
October 7, 2001
October 7, 2001
![sp_UserOfflineSmall](https://nordichardware.se/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_UserOfflineSmall.png)
Vad händer om en tråd t som går in i getLength() och blir avbruten av en annan tråd med t.interrupt() när tråden t kommer till wait().
Lämnar wait() fortfarnade ifårn sig låset och fångas sedan av catch(InterruptedException ie) ?
Och sedan på nytt anropar wait() eller ?
synchronized int getLength() {
while(!flag) {
try {
wait();
} catch(InterruptedException ie) {
ie.printStackTrace();
}
}
flag = false;
return length;
}
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 694
Currently Online:
Guest(s) 66
Currently Browsing this Page:
2 Guest(s)
2 Guest(s)
Top Posters:
Andreas Galistel: 16287
Jonas Klar: 15897
ilg@dd: 10810
Nyhet: 10607
Mind: 10550
Ctrl: 10355
Gueno: 9881
Guest: 9344
Snorch: 8881
Callister: 8468
Newest Members:
PetrbonFU PetrbonFU
Karine Bembry
Dolores Mcdaniels
Anibal McLeish
Francisca Alt
Alfie Everhart
Lester Huitt
Orlando Jorgensen
Mikki Lundgren
Dakota Kozlowski
Forum Stats:
Groups: 11
Forums: 59
Topics: 146630
Posts: 1300967
Member Stats:
Guest Posters: 2
Members: 79425
Moderators: 0
Admins: 11
Administrators: nordicadmin, Henrik Berntsson, Anton Karmehed, Carl Holmberg, Joel Oscarsson, Mikael Linnér, Mikael Schwartz, Andreas Paulsson, Nickebjrk, Mattias Pettersson, EmxL
© Simple:Press —
![sp_Information](https://nordichardware.se/wp-content/sp-resources/forum-themes/reboot/images/darkpack/sp_Information.png)