Steve Luke wrote:Wait, what? You want to join threads without using the mechanism used to join threads? Why?
Define what you want to do, and why you want to do it. Talking about join will probably confuse things, because it is an implementation and not an intent.
Agreed. Generally, if you want to do something, and the normal way to do that something isn't what is wanted, then perhaps it is best to take a step back and quickly look at what you want, than continuing down the rabbit hole (or arguably, more like a rat hole).
Can you elaborate what you are trying to accomplish at a higher level?
Actually I am trying to join two threads created using callable and future. Please let me know if this is achievable.
Ahh, Callable/Future don't create threads. They are callbacks you can use with Executors to run code in the Threads managed by the Executor and get feedback on when the task is done. If you could get access to the Thread which the Callable is run in, you wouldn't want to join it, because it could never end (in most Executor implementations anyway). What you want to do is wait until the Callable's work is complete. Future has methods that will let you do that. Take a look at the API (in the link) to see.