Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptquitmainloop.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptquitmainloop.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptquitmainloop.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptquitmainloop.html on line 8

PtQuitMainLoop()

Cause PtMainLoop() in the calling thread to return

Synopsis:

int PtQuitMainLoop( void );

Library:

ph

Description:

This function causes PtMainLoop() in the calling thread to return right after it finishes processing the current event.


Note: PtQuitMainLoop() doesn't affect any modal operations that the thread is currently doing; if you call PtQuitMainLoop() from within a modal loop, there's no way for PtMainLoop() to return until after the modal loop has completed.

Keep in mind that if you let your main() function return, exit() is called and your application is terminated without letting any widgets or threads do any cleaning up. It's better to call PtExit() instead -- the main purpose of PtQuitMainLoop()is to let you terminate threads running PtMainLoop() without terminating the application.

To ensure your application doesn't terminate, put a pthread_exit() call after the PtMainLoop() call in main(). In PhAB, changes to main() get overwritten by PhAB, so you should declare a global header for your application and map PtMainLoop() to your own function using a macro. For example:

    #undef PtMainLoop
    void MyMainLoop( void ) {
       PtMainLoop();
       pthread_exit(NULL);
       }

Returns:

0
Success.
-1
The thread has already called PtQuitMainLoop().

Classification:

Photon

Safety:
Interrupt handler No
Signal handler No
Thread No

See also:

PtExit(), PtMainLoop()

Threads in the Parallel Operations chapter of the Photon Programmer's Guide


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/photon/lib_ref/pt/ptquitmainloop.html on line 138

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/photon/lib_ref/pt/ptquitmainloop.html on line 138