• Post Reply Bookmark Topic Watch Topic
  • New Topic

Monitors  RSS feed

 
Betty Reynolds
Ranch Hand
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had always equated obtaining a lock on the object with maintaining its integrity with respect to its data, but given that the monitor gives up its lock when issuing the wait (I guess it has to--how else can the thread that issues the notify or notifyall execute) my question is: Are the variables defined by the object threadsafe at this point? That is, can they be modified by some thread in between the time the wait is issued and the notify takes place? Or is it a question of scope (i.e., just those inside the synchronized code are, etc.)
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!