Re: [Tracker] Killing run-away child processes



Jamie McCracken wrote:
Jamie McCracken wrote:


Another way to do this is within tracker-extract with the extraction performed in another thread with the main thread being a timer that kills itself if it timeouts.

oops wrong way round - should be main thread uses for extraction with another created thread to perform the exit on timeout




code should look like:

static void
timeout_thread (void)
{
        /* sleep for 10 secs */
        g_usleep (G_USEC_PER_SEC * 10);

        /* die on timeout */
        exit (1);

}


at start of tracker-extract :

g_thread_create ((GThreadFunc) timeout_thread, NULL, FALSE, NULL):


--
Mr Jamie McCracken
http://jamiemcc.livejournal.com/




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]