Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help in Threads join

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I am starting two threads from a Normal Java class .
The Threads are namely One and Two .
I want Thread "Two" to start only after One has completed its execution .

This is my Code , but it isn't working .Please help .









Is this possible to achive ??
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need two threads for this. After all, One and Two don't need to be executed in parallel. Just create one Runnable. If for some reason you cannot or will not join the two classes in one you can wrap them:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic