Re: Killing a Thread
Re: Killing a Thread
- Subject: Re: Killing a Thread
- From: Mahaboob <email@hidden>
- Date: Wed, 26 Nov 2008 12:49:55 +0530
- Thread-topic: Killing a Thread
On 11/25/08 10:50 PM, "Joseph Kelly" <email@hidden> wrote:
>
> On Nov 25, 2008, at 1:17 AM, Mahaboob wrote:
>
>> On 11/25/08 2:33 PM, "Mahaboob" <email@hidden> wrote:
>>
>>>
>>>
>>>
>>> On 11/24/08 10:01 PM, "Joseph Kelly" <email@hidden> 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 (email@hidden)
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:
This email sent to email@hidden