Bernd Eilers wrote:
Hi Stephan,
waitpid, wait3, wait4 etc. should also terminate when a signal for which
an signal handler has been installed is being called so what about
installing a signal handler for SIGUSR1 start an additional timer thread
then call waitpid in the main thread without WNOHANG and have that timer
thread send you a SIGUSR1 after the timeout. Provided we are not already
using SIGUSR1 for any other feature yet.
Yes, I had also thought about using signals. However, signals and
threads don't mix well, so that any solution down this line would
probably need a convoluted framework (there is only one global action
for any given signal, so any process that happens to use the sal library
would be restricted in how it can use SIGUSR1).
Anyway, browsing the tomes, I found out that pthread_cancel could be of
help here: waitpid is guaranteed to be a cancellation point, so the
current code could be fixed by making osl_terminateProcess do a
pthread_cancel and pthread_join on the waitpid thread before calling
kill on the child pid, and then to spawn a new waitpid thread if necessary.
-Stephan
[...]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]