Middleware, development tools, realtime operating system
software and services for superior embedded design


Home
QNX Community Resources
QNX Documentation Library
PtAllowExit

PtAllowExit

QNX Software Systems
Developer Resources
Blogs
Board support packages
Foundry27 projects
Forums
Hardware support listing
Online video tutorials
Product documentation
Technical Articles

PtAllowExit()

Allow a Photon application to exit

Synopsis:

void PtAllowExit( void );

Library:

ph

Description:

PtAllowExit() lets Photon know that it's safe to exit your application.

In a multithreaded application, any thread can call PtExit(), but another thread might be in the middle of an important operation, such as writing a file. To prevent this situation from arising, call PtPreventExit() before starting the operation, and call PtAllowExit() when it's done.


Note: Instead of calling PtPreventExit() and PtAllowExit() directly, you're better off calling PtEnter() and PtLeave() with Pt_DELAY_EXIT set in the flags. For a discussion of the difference between these functions and using Pt_DELAY_EXIT, see "Exiting a multithreaded program" in the Parallel Operations chapter of the Photon Programmer's Guide.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

PtEnter(), PtExit(), PtLeave(), PtPreventExit()

Parallel Operations chapter of the Photon Programmer's Guide