Hi, I wrote a mail some time ago, but nobody answered me :(
My problem is that I had two threads. The second one was a pthread. I
performed and exit from a callback, so I had to pthread_cancel the secondary
thread to avoid a race condition and an eventual app crash.
Now, I'm using GThreads. I
when it was
created with pthread instead of g_thread?
-- Forwarded message --
From: Tristan Van Berkom [EMAIL PROTECTED]
Date: 24-abr-2006 19:21
Subject: Re: Gthreads again
To: Fernando Apesteguía [EMAIL PROTECTED]
Cc: gtk-app-devel-list@gnome.org
Fernando Apesteguía wrote
Fernando Apesteguía wrote:
The main thread is the only one that is running inside the gtk_main loop.
The secondary thread is only reading files. So if I do a gtk_main_quit() the
secondary thread will be no longer running because I have not a gtk_main
loop, right?
Wrong, the main thread is not
And how to kill the gthread if there is not something like pthread_cancel?
(Thanks for your patience)
Best regards
-- Forwarded message --
From: Tristan Van Berkom [EMAIL PROTECTED]
Date: 24-abr-2006 20:04
Subject: Re: Gthreads again
To: Fernando Apesteguía [EMAIL PROTECTED]
Cc
Fernando Apesteguía wrote:
And how to kill the gthread if there is not something like pthread_cancel?
(Thanks for your patience)
Tell the thread it has to exit
o through a variable mutex/condition
o through any form of ipc (maybe simply a pipe())
call g_thread_join() from the main