Passing player object around in thread

Discussion in 'Plugin Development' started by Tomato, Aug 31, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    Tomato

    Hello all,

    I am creating threads for each player and would like to be able to pass the thread the player object for use with the spout api. I am not doing any write operations on the object, just passing it around. Will having each thread pass it's player object to a synced PlayMusic wrapper cause a ConcurrentMod exception? Or should I be handling all player objects as strings and only perform the lookup in a synced scheduler runnable?

    Thanks!
     
  2. Offline

    Tomato

    I guess what I am asking is if it is ok to pass around a player object to a thread but never modify it.
     
  3. Well, the error you're asking about is ConcurrentModifyException, so I would say: Yes, it's ok.
     
Thread Status:
Not open for further replies.

Share This Page