On 11/25/08 10:50 PM, "Joseph Kelly" <[EMAIL PROTECTED]> wrote:
> > On Nov 25, 2008, at 1:17 AM, Mahaboob wrote: > >> On 11/25/08 2:33 PM, "Mahaboob" <[EMAIL PROTECTED]> wrote: >> >>> >>> >>> >>> On 11/24/08 10:01 PM, "Joseph Kelly" <[EMAIL PROTECTED]> wrote: >>> >>>> Why can't your thread just return when it's finished? >>>> >> I'm new to thread programming. I need to kill the thread in a void >> function. >> Here I'm attaching the file. Is it I'm going right way? > > I looked at your code, and you really have no need to explicitly kill > the thread. When you set your m_isBackgroundThreadToTerminate to YES > and tell the run loop to stop, it should just exit. If it's crashing, The application is not crashing, but the thread is not exiting. From UI I'm giving a time interval say 10sec is set for the time interval between emails to be send. At the first time when I'm clicking the button to send email, the thread is getting called and is working fine and sends email to all email id's with a time interval of 10Sec. After that the thread is not exit and invokes the thread in every 10Sec. So when I'm button second time, the application get hanged, all windows and buttons get disabled and I can quit the application from debugger only. > > I think it's probably due to some other kind of issues (in which case > you will find this link to be quite valuable: > http://developer.apple.com/technotes/tn2004/tn2124.html) > . > > If you are developing for 10.5 only, I would strongly recommend using > NSOperation, which effectively hides some of the details of threading > and concurrency. > I need to build it towards 10.4. > Joe K. _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]