Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I need to synchronize a block of code...

 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm making a card game where I move cards around a few times each round. The card movements takes place in a thread. I keep getting java.lang.IllegalThreadStateException errors when my thread is trying to be executed while in progress already. Can anybody help me out here?
Here is the code that determines how many different movements there should be and finally calls the start on the moveCard Thread.
 
Chris Stewart
Ranch Hand
Posts: 184
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ah, nevermind. I just created a Thread that handles the movement. I made the moveCards method synchronized and everything was perfect.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic