On Thursday 26 July 2007 05:24:45 Andreas L Delmelle wrote:
> On Jul 24, 2007, at 22:09, Andreas L Delmelle wrote:
>
> For those interested, I (think I) managed to verify the below
> statement, while toying around with improperly synchronized code.
> Although nothing was explicitly multi-threaded, I did use Object.wait
> () and Object.notify(), and those map to native methods that crashed
> with errors like "current thread not owner", because the Java code
> was not in synch.

This error is more due to the fact that you *always* need to call wait/notify 
inside a synchronized block on the same object you want to call the method 
on, e.g.:

  synchronized(obj) {
    obj.wait();
  }

  // Somewhere else
  synchronized(obj) {
    obj.notify();
  }

Daniel


-- 
Daniel Noll
Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://nuix.com/                               Fax: +61 2 9212 6902

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to