Article View: borland.public.jbuilder.java.language
Article #7348Re: Fun with threads
From: CLG
Date: Sat, 23 Jun 2001 16:14
Date: Sat, 23 Jun 2001 16:14
40 lines
2140 bytes
2140 bytes
Have you tried calling Thread.join() on the subthread from the main thread? when the main thread is done doing its job, just call thread.join and after that call popup your notification. Or, the best way. Just set a variable in the main thread from the sub thread. have the main thread check that var to see if it should keep running. -- Peace, Carl L. Gilbert lamont_gilbert @ rigidsoftware.com http://www.rigidsoftware.com ICQ 614395-currently stolen working to retrieve. "Then said I, Wisdom [is] better than strength: nevertheless the poor man's wisdom [is] despised, and his words are not heard." Ecclesiastes 9:16 "Sean Capstick" <nospam.scapstick@dimensions.ca> wrote in message news:3b320ce8_1@dnews... > How can I notify a program's main thread that it's okay to terminate? I > have a program that does this: > Program starts > Starts a thread to do some background processing > Main thread continues to run, handle the user interface, etc. > Processing thread will eventually finish. > User must close the program > > When the processing is finished, I want to signal the main thread which will > pop up an 'All done' message box and then terminate. How should I > accomplish this? > > Thanks, > Sean > >
Technical Details
Message-ID:
<3b34c14c$1_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnewsReferences:
<3b320ce8_1@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,2fd1c7b03719c733 X-Google-Attributes: gidf74b3,public X-Google-ArrivalTime: 2001-06-23 09:29:18 PST From: "CLG" <lamont_gilbert @ rigidsoftware.com> Newsgroups: borland.public.jbuilder.java.language References: <3b320ce8_1@dnews> Subject: Re: Fun with threads Date: Sat, 23 Jun 2001 12:14:09 -0400 Lines: 42 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 24.181.226.14 Message-ID: <3b34c14c$1_1@dnews> X-Trace: dnews 993313100 24.181.226.14 (23 Jun 2001 09:18:20 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!newsfeed.google.com!sn-xit-02!supernews.com!nntp-relay.ihug.net!ihug.co.nz!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.wirehub.nl!PeerFeed.KWeb.on.ca!dnews