![]()  | 
![]()  | 
![]()  | 
![]()  | 
![]()  | 
This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. | 
Exit a Photon program
void PtExit( int return_code );
ph
This function is similar to exit(), except that PtExit() properly destroys all your application's widgets before exiting.
In a multithreaded application, a callback can call PtExit() in one thread while a second thread might be in the middle of an important operation, such as writing a file. To prevent the second thread from terminating early, call PtPreventExit() before starting the operation, and call PtAllowExit() when it's done.
![]()  | 
Instead of calling PtPreventExit() and PtAllowExit() directly, you're better off calling PtEnter() and PtLeave() with Pt_DELAY_EXIT set in the flags, because the Pt_DELAY_EXIT flag may not cause your application to lock up in some situations where PtPreventExit() would. 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. | 
Before exiting, PtExit():
This function doesn't return.
Photon
| Safety: | |
|---|---|
| Cancellation point | No | 
| Interrupt handler | No | 
| Signal handler | Not applicable | 
| Thread | Yes | 
PtAllowExit(), PtEnter(), PtLeave(), PtPreventExit()
exit() in the QNX Neutrino Library Reference
![]()  | 
![]()  | 
![]()  | 
![]()  |