use wait()/get() instead of while(!f.isReady()) { ... }