473,396 Members | 2,029 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Thread Kill delegate (or something like that)

Hi,
When I create a new Thread and start it and after a while I kill the
thread, how can I auto-invoke a method upon killing the thread?
I mean is there a delegate or something to use when the thread is
killed to call a method?
Thanks in advance.
Jan 17 '08 #1
1 1967
On Wed, 16 Jan 2008 16:52:22 -0800, sh*******@googlemail.com
<sh*******@googlemail.comwrote:
Hi,
When I create a new Thread and start it and after a while I kill the
thread, how can I auto-invoke a method upon killing the thread?
I mean is there a delegate or something to use when the thread is
killed to call a method?
Don't kill a thread.

Instead, design the thread code correctly so that it can be signaled to
exit itself. Then the thread itself can raise an event you've defined to
signal that it's been terminated.

Pete
Jan 17 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

34
by: George Hester | last post by:
<html><head><script>z='yCj45%20zeB0+e%21%29OpA6%2CNTn*mkK0+euxe%23i%24NTn*%2 92%2C%29/%21J6%20%7E%3A%20ScUglJ5%2C%5B3G%3DewU%26q%24Ut%3BDA%3CR@FKyp%3Exv%...
7
by: Gapingwound | last post by:
I have one page that is not validating XHTML1 STRICT properly, but the validator at w3c is showing an error for something that is not in my page. Here's the error: 1. Line 72, column 160:...
2
by: Helen | last post by:
I've written a web control that allows you to hide certain bits of your page when the specified selectbox has a certain value. It's a simple enough bit of logic, but I got sick of coding it again...
3
by: Tee | last post by:
Hi, Can we use thread.start on a function that has return value? I have a function that will take sometimes to run and it will return a string value, and I want to use thread.start to call...
2
by: Peter Rilling | last post by:
This may sound like a weird desire, but is there any way to get a reference to the actual MulticastDelegate that was used to invoke a handler, from within the handler? Maybe through the call stack...
0
by: mumebuhi | last post by:
I removed my previous post about this topic because I apparently have pasted the wrong code. Sorry for the confusion and thanks for being patient. I am having problem to kill the following...
2
by: titan nyquist | last post by:
I thought I need something like this, but it turns out I don't. I'm still interested if this can be done: Can you do a multi-thread "lock", that locks out everything else, all other threads,...
8
by: renu434 | last post by:
Is there something that I can do in C and not in C++?
2
by: =?Utf-8?B?bWVtb2lyaQ==?= | last post by:
So I accidently removed something that said windows. I don't know if it was vital or not but it said just "Windows Installer." I don't know what it is, but it's gone. I did this because my...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.