Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to synchronize these threads  RSS feed

 
mike Vigor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So this is my very first java program involving threads...is a game in which there are going to be 39 rounds...and it may involve up to 8 people...at everyround
every persone must have a turn to make a move... so i implemented a sort of controller for the game using threads...but I can't even synchronize the basic stuff sic
am going to post the snippet so that the more seasoned java programmers can give a look...am going to pin point some areas with comments...


2nd part
 
mike Vigor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I solved it..putting synchronized before run() and all was well
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!