Re: To kill a GThread
- From: Chris Vine <chris cvine freeserve co uk>
- To: gtk-list gnome org, raphtee gmail com
- Cc:
- Subject: Re: To kill a GThread
- Date: Fri, 16 Dec 2005 09:42:59 +0000
On Friday 16 December 2005 02:13, Travis Miller wrote:
> Hi,
>
> I am trying to figure out how to kill a GThread that I created using
> g_thread_create(). I couldn't find anything in DevHelp that would
> indicate a way to kill a thread. It seems the only way is to signal the
> thread and have the thread call g_thread_exit() itself. Is there a way
> to kill a thread from another thread directly?
You would have to write some implementation-specific code. If you know that
the underlying implementation is pthreads, you could get the thread id of the
thread you want to cancel and call pthread_cancel() on it, after calling
pthread_cleanup_push() or pthread_cleanup_pop() as necessary to ensure the
cancelled thread cleans up its resources (such as memory allocated on the
heap). I believe Windows has a similar call, but I do not know its name, nor
whether it chooses a similar set of cancellation points.
Chris
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]