Article View: borland.public.jbuilder.java.language
Article #22Stopping threads...
From: Vladimir Olenin
Date: Mon, 14 Sep 1998 00:00
Date: Mon, 14 Sep 1998 00:00
51 lines
2483 bytes
2483 bytes
This is a multi-part message in MIME format. --------------E4D7F321A3618205345F0ACE Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: 7bit Actually, evrth works, but why it work in that way, i don't understand. So, i have a class TH that extends Thread. Method run() is not synchronized. When i'm trying to stop this thread (TH.stop()) i'm ranning into following problem: - TH.stop() is the "last" line of method run(). All resources are closed before calling this function. ---- Evrth is fine and works. - TH.stop() is in the middle of method run() or a function that calls it. Program hangs. Talking about resources, i have in/out streams and socket. All of them certainly must be closed. But it hangs only on that line, no matter where it exactly stands. (eg, before or after in.close(), socket.close(), etc). In a function i process a message, where the object TH used as an argument. If i put stop() method before proceeding a message, then, again, it hangs. If after, evrth works. What's more, when u close application, program begin to close resources (i mean lines after TH.stop() start to execute). So, does anybody here knows the answer or just gets some thoughts about this problem. Thanks 4 yr time and 4 possible answer. --------------E4D7F321A3618205345F0ACE Content-Type: text/x-vcard; charset=koi8-r; name="keenonjava%mypad.com.vcf" Content-Transfer-Encoding: 7bit Content-Description: Card for Vladimir Olenin Content-Disposition: attachment; filename="keenonjava%mypad.com.vcf" begin:vcard n:Olenin;Vladimir x-mozilla-html:FALSE org:adr: adr: version:2.1 email;internet:keenonjava@collegemail.com title:Card note:Java programmer. Open for projects development offers. fn:Vladimir Olenin end:vcard --------------E4D7F321A3618205345F0ACE--
Technical Details
Message-ID:
<35FC60E9.73D13B3B@collegemail.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,9bca7a1d6ef312de,start X-Google-Attributes: gidf74b3,public X-Google-Thread: ff01d,9bca7a1d6ef312de,start X-Google-Attributes: gidff01d,public From: Vladimir Olenin <keenonjava@collegemail.com> Subject: Stopping threads... Date: 1998/09/14 Message-ID: <35FC60E9.73D13B3B@collegemail.com> X-Deja-AN: 390828724 X-Accept-Language: ru Content-Type: multipart/mixed; boundary="------------E4D7F321A3618205345F0ACE" Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language,borland.public.jbuilder.applet-issues