r16015 - gnucash/trunk/src/app-utils - Give the child process a real chance to die before we kill it.

Andreas Köhler andi5.py at gmx.net
Sat Apr 28 13:58:56 EDT 2007


Hi,

David Hampton schrieb:
> On Sat, 2007-04-28 at 12:04 -0400, Andreas Köhler wrote:
>  
>> -  if (kill_it) {
>> +  if (kill_it && !proc->dead) {
>>      /* give it a chance to die */
>> -    g_main_context_iteration (NULL, FALSE);
>> +    while (g_main_context_iteration (NULL, FALSE) && !proc->dead)
>> +      ;
> 
> Can this block forever waiting for the process to die?

It should not.  Assuming that no event source dispatch function blocks 
and the child process does not exit, the loop should only block forever 
if there is a never-ending stream of event sources being ready for 
processing.  g_main_context_iteration returns TRUE iff there were events 
actually dispatched.

> David

-- andi5


More information about the gnucash-devel mailing list