Does anyone know if it's possible to have an Ada-style select statement for threads in Java or if there is an equivalent way to do it?
Specifically I would like to be able to use structures:
select
javaThread.someEntry();
else
//do something else if call not accepted straight away
end select
or
select
javaThread.someEntry();
or
//delay before entry call expires
end select
Where someEntry()
is a synchronized method that could take a bit of time to enter due to a lot of other threads wanting the lock as well.
Thanks!