• Post Reply Bookmark Topic Watch Topic
  • New Topic

Have i done this the right way ? Page-760(K&B 7)

 
Akash Trivedi
Greenhorn
Posts: 18
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
    Just want to know is it the correct way to implement wait()  & notifyAll() ?.Or is there any test case which can exploit this code ?


    //code  to implement wait() using loop.

     
 
Ankit Garg
Sheriff
Posts: 9591
34
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Akash, what exactly are you trying to achieve with the code i.e. what is the output that you expect? That will decide if this is implemented correctly or not. It should print 190 in all the reader threads...
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!