:: Re: [DNG] netman GIT project
Top Page
Delete this message
Reply to this message
Author: Rainer Weikusat
Date:  
To: dng
Subject: Re: [DNG] netman GIT project
Edward Bartolo <edbarx@???> writes:

> I tried several ways to use grey-out buttons but there is a bug or
> something that is preventing me. The only way I found is
> multi-threading or simply leaving the main thread to wait for the
> backend to finish its job until it becomes available to the user.
> Multi-threading can allow the user to click the same button several
> times in a very short time creating as several concurrent threads
> attempting to do the same thing. I tried to prevent this by counting
> the number of thread objects created but there is a bug that is
> preventing the created object to decrement the variable when their
> destructor is called. So, I am sort of, stuck. :(
>
> The only way that does not allow multiple similar threads is to allow
> the GUI to become momentarily unresponsive.


Nope. You can still either react to SIGCHLD in order to reap exit status
information as soon as it becomes available or set the disposition of
SIGCHLD to SIG_IGN in order to avoid the need to wait for deceased
process altogether. Considering that the Linux execve leaves this
SIGCHLD dispostion unchanged in this case, you could even do that with a
small C program invoking the Pascal program making up the actual GUI.