This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Remove shared memory references
void PgShmemCleanup();
ph
This function removes all shared memory references that you defined with PgShmemCreate() and PgShmemAttach(). If you created the block with PgShmemCreate(), the block is unlinked.
The Photon library uses atexit() to arrange for PgShmemCleanup() to be called when your program terminates normally. If your program terminates abnormally, it should call PgShmemCleanup() explicitly.
This code fragment shows how you can use PgShmemCleanup() in a signal handler:
void ExitCleanup( int sig ) { sig = sig; PgShmemCleanup(); _exit( 1 ); } main( ... ) { ... signal( SIGTERM, ExitCleanup ); signal( SIGHUP, ExitCleanup ); signal( SIGQUIT, ExitCleanup ); signal( SIGINT, ExitCleanup ); /* main loop */ ... }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PgShmemAttach(), PgShmemCreate()
atexit() in the QNX Neutrino Library Reference