Re: [Tracker] Killing run-away child processes



Le jeudi 16 novembre 2006 Ã 01:15 +0000, Jamie McCracken a Ãcrit :
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):


You said all... (patch included)


Laurent.

Attachment: add-timeout-in-tracker-extract.diff
Description: Text Data



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