Results 1 to 2 of 2

Thread: notify()

  1. #1
    rajpan06 is offline Member
    Join Date
    May 2013
    Posts
    10
    Rep Power
    0

    Default notify()

    I opened and read api for notify() method there it is mentioned that if any threads are waiting on this object one of them is to be awakened . My doubt is if there is no thread in waiting then what happen . Is it throw any exception . . . I tried it but still confused

  2. #2
    kjkrum's Avatar
    kjkrum is offline Senior Member
    Join Date
    Apr 2011
    Location
    Tucson, AZ
    Posts
    1,060
    Rep Power
    6

    Default Re: notify()

    It will throw an IllegalMonitorStateException if the current thread doesn't hold the lock on that object. Otherwise, nothing happens.
    Get in the habit of using standard Java naming conventions!

Similar Threads

  1. Wait() and Notify()
    By SiX in forum New To Java
    Replies: 15
    Last Post: 07-28-2011, 04:29 PM
  2. How to get notify from PickBehavior method?
    By johny2011 in forum Advanced Java
    Replies: 0
    Last Post: 04-27-2011, 03:52 PM
  3. wait() and notify()
    By jomypgeorge in forum New To Java
    Replies: 4
    Last Post: 02-15-2011, 08:58 AM
  4. Need help with wait and notify
    By mityay in forum Threads and Synchronization
    Replies: 3
    Last Post: 01-06-2011, 04:24 PM
  5. Need help with wait() and notify()
    By Mkaveli in forum Threads and Synchronization
    Replies: 2
    Last Post: 03-30-2010, 11:58 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •