PtHelpTopic

I’m using the PtHelpTopic() function. It works fine and opens the
helpviewer, but as soon as I close the helpviewer, my Photon app freezes.

Markus

Markus Loffler <loffler@ces.clemson.edu> wrote:

I’m using the PtHelpTopic() function. It works fine and opens the
helpviewer, but as soon as I close the helpviewer, my Photon app freezes.

Can you elaborate on “freezes”?

What does pidin say?

Does everything work OK you don’t close Helpviewer?

Does everything work OK if you start helpviewer beforehand?


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.

pidin says my app is reply blocked.
“Freezes” means no widgets are responding, but I can still move the windows
around (however, no repaint is happening).

I figured out what’s going on. If have a Photon signal handler that reponds
to SIGCHLD with a wait(), since my app is spawning a child process. When I
close the helpviewer, it generates a SIGCHLD, but the wait() hangs forever.
If there is a way to find out which child generated the signal, I could just
ignore it it case of the helpviewer…?

Markus


“Wojtek Lerch” <wojtek@qnx.com> wrote in message
news:9gt8cq$2qf$1@nntp.qnx.com

Markus Loffler <> loffler@ces.clemson.edu> > wrote:
I’m using the PtHelpTopic() function. It works fine and opens the
helpviewer, but as soon as I close the helpviewer, my Photon app
freezes.

Can you elaborate on “freezes”?

What does pidin say?

Does everything work OK you don’t close Helpviewer?

Does everything work OK if you start helpviewer beforehand?


Wojtek Lerch (> wojtek@qnx.com> ) QNX Software Systems Ltd.

Markus Loffler <loffler@ces.clemson.edu> wrote:

pidin says my app is reply blocked.
“Freezes” means no widgets are responding, but I can still move the windows
around (however, no repaint is happening).

I figured out what’s going on. If have a Photon signal handler that reponds
to SIGCHLD with a wait(), since my app is spawning a child process. When I
close the helpviewer, it generates a SIGCHLD, but the wait() hangs forever.

Not forever – only until your child process terminates, right?

That’s what wait() is supposed to do. But since it’s not what you want
your program to do, you should not call wait()…

Instead, call waitpid() with the WNOHANG flag, and give it the right
pid. It will return zero if the SIGCHLD was generated by another child
process.

Or simply use PtSpawn() – it will do the signal handling and the
waitpid() for you.


Wojtek Lerch (wojtek@qnx.com) QNX Software Systems Ltd.