We don't bite newbies here... much | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Personally, I would translate any normally fatal signal into a direct call to TerminateThread() if the process ID that is the subject of the signal is a pseudo-process ID. Whilst TerminateThread() is usually a bad thing, given the aim here is to allow the main thread to get past a wait or waitpid and exit the process, when the thread will be summarily abandoned anyway, it amounts to the same thing. The advantage is that you supply TerminateThread() with an exit code, which will then be reported back (via GetExitCodeThread()) as if it were the return value from the thread proc in the normal way, hence to the the rest of perl, and the program, it will seems as if the thread just ended. Of course, clean-up will not have been done, so it will likely leak like a bitch and possibly cause deadlocks through unreleased semaphores, mutexes and critsecs. But if the goal is just to allow the main process to terminate, that doesn't matter. Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
In reply to Re: Proposal how to make modules using fork more portable
by BrowserUk
|
|