Exemple
public
static
class
ClasseA {
Condition c;
boolean
flag;
public
void
methodeA {
if
(flag) {
try
{
c.await();
}
catch
( Exception e ) {
}
//...
}
}
}
Solution
Placez await() dans une boucle while.
public
static
class
ClasseA {
Condition c;
boolean
flag;
public
void
methodeA {
while
(flag) {
try
{
c.await();
}
catch
( Exception e ) {
}
//...
}
}
}