[Previous] [Contents] [Index] [Next]

PtPreventExit()

Prevent a Photon application from exiting

Synopsis:

void PtPreventExit( void );

Library:

ph

Description:

PtPreventExit() lets Photon know that it isn't 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.

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread Yes

See also:

PtAllowExit(), PtEnter(), PtExit(), PtLeave()

Lengthy Operations chapter of the Photon Programmer's Guide


[Previous] [Contents] [Index] [Next]