To tu nikto nema cvika s CHovanakom ? Ci ako sa vola ten, co ma cvika hned po prednaske vo V101b ? On da ake otazky ?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Zobrazi» príspevky MenuQuote from: DeeL on 02.03.2008, 21:48:42Quote from: wlade on 02.03.2008, 21:29:02tak pokial je to presne to na co myslim:
...
v HostListImpl mas chybu v tom riadku metody stop() kde volas notify() nad threadom v ktorom bezi GC... potrebujes ho mat tiez v bloku synchronized... a ze odkial to mozes vediet... staci si poriadne popozerat kedy sa hadze taka vynimka a ine veci... da sa to pekne zistit
EDIT: tak pre doplnenie uvadzam vynatok z JAVA API konkretne z popisu funkcie notify()
This method should only be called by a thread that is the owner of this object's monitor. A thread becomes the owner of the object's monitor in one of three ways:
* By executing a synchronized instance method of that object.
* By executing the body of a synchronized statement that synchronizes on the object.
* For objects of type Class, by executing a synchronized static method of that class.
Only one thread at a time can own an object's monitor.
Quotehashtime = IConstants.LIFETIME_OF_HOSTINFOS;
rozdiel = new Date().getTime()-iHostInfo2.getTimestamp();
if (rozdiel>hashtime){
iHostList.remove((iHostInfo2.getHostInfoMessage()).getRegistryHost()+":"+(iHostInfo2.getHostInfoMessage()).getRegistryPort());
System.out.println("HT:\t"+iHostInfo2.getHostInfoMessage().getHumanReadableName());
}