blocking calls in java
- From: appcoder@xxxxxxxxxxxx (Gyro)
- Date: 29 Apr 2005 05:22:16 -0700
Hello, I need to block current thread, waiting for flag/event. Plz give advice.
My attempts:
public synchronized void blockingFormCreate() {
createAndShowForm(); // Create and show screen form
wait(); // Fall asleep
. . .
}
public synchronized void setEvent() {
notify(); // wakeup, continue processing
}
volatile boolean event; // field
private void blockingFormCreate() {
event = false;
createAndShowForm(); // Make a form
for(; !flag; yield()) ; // Blocking
. . .
}
where I`m correct/incorrect ?
.
- Follow-Ups:
- Re: blocking calls in java
- From: Daniel Dyer
- Re: blocking calls in java
- Prev by Date: Re: how to read 16 - bit values?
- Next by Date: Re: How to determine line break in textarea?
- Previous by thread: HELP - 3D Tutorials anyone?
- Next by thread: Re: blocking calls in java
- Index(es):