Google-Apps
Hauptmenü

"g_thread_cancel?"

3 Comments -

1 – 3 of 3
Anonymous Anonymous said...

Well, actually I hesitated before answering Richard via Planet GNOME, and I considered mailing him. Finally urge combined with lazzyness (to figure out his e-mail address) won.

21 November 2007 at 07:15

Blogger Unknown said...

Hello,

You should rather consider do yourself a clean cancel of the thread pthread_cancel() has a difficult semantic to implement and pthread_kill() will not be a clean solution.
Resource allocated during the thread have to be cleaned up properly.

You'd rather do the following (with proper locks) :

thread_run()
{
while (has_some_work_to_do) {
if (cancelled)
return;
do things;
}
}
thread_cancel()
{
cancelled = true;
}

22 November 2007 at 01:21

Blogger Bastien Nocera said...

Viêt Hoà, you already pasted that in Mathias' blog...

22 November 2007 at 09:20

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.
Please prove you're not a robot