The use of  "this" is just plain redundant since Cliente.class is by
default derived from "java.lang.Object" it is not nessassary to
append "this." to wait() or notify() or any other of the monitor metheds
in this case. Hint : take a look at the core API class hierarchy.

Cheers
Chris

[EMAIL PROTECTED] wrote:

On Mon, 14 Dec 1998, Carlos Alberto Roman Zamitiz wrote:

> Hi, I attached my Cliente.java
> I have 2 threads: Receptor and Transmisor. Receptor sends and receives
> data from server, using method recibirPeticion(), forever (well, it sleeps
> 3 seconds). When Transmisor sends data, using method enviarPeticion(),
> Receptor must wait until Transmisor ends his transmition.
>
> I get
> java.lang.IllegalMonitorStateException: current thread not owner

You need to do just this.wait() and this.notifyAll(), notification happens
on the object Receptor and not on the threads.

. . . Sean.

begin:vcard 
n:Hinds;Christopher 
tel;fax:718-789-7906
tel;home:718-789-7906
x-mozilla-html:FALSE
org:Heuristic Systems, Inc.
version:2.1
email;internet:[EMAIL PROTECTED]
title:Chief Engineer - President
adr;quoted-printable:;;160 FIFTH AVE=0D=0ASUITE 4R;Park Slope;NY;11217;USA
x-mozilla-cpt:;0
fn:Christopher Hinds
end:vcard

Reply via email to