Sorry, I do not know you, I just need one operation at time on the library, I do not know because I need to count operations.
Every function have it's Runnable, what I need is to just call an operation and wait to finish.
I still read about executor, you used:
this prevents to execute more thead at time?
I cannot use executor.shoutdown() or something similar when operation is finisched and prevent other functions to be executed (just put in quee) until current operation was finished?
Maybe put an executor as global variable in a class so it do just one thread at time waiting until it finish ?
Every function have it's Runnable, what I need is to just call an operation and wait to finish.
This is a problem, I'm not so good on Java.PS: You might need to use the synchronized keyword or use locks for thread safety, the sample above is untested.
I still read about executor, you used:
Java:
final Executor executor = Executors.newSingleThreadExecutor();
I cannot use executor.shoutdown() or something similar when operation is finisched and prevent other functions to be executed (just put in quee) until current operation was finished?
Maybe put an executor as global variable in a class so it do just one thread at time waiting until it finish ?