[Prev] [Contents] [Next]

Thread Cancelation APIs

You can use thread cancelation APIs to cause a thread to end prematurely, or to aid in cleanup when a thread is ended (either prematurely or normally). The thread cancelation APIs work together to provide a mechanism for thread cleanup and protecting threaded resources from cancelation. The thread cancelation APIs only provide clean up and protection in relationship to other pthread APIs. You cannot protect from or clean up when a thread ends as a result of your process ending (normally or abnormally), or when the thread ends via some mechanism outside of the pthread API set. Some examples of mechanisms that can terminate a thread that are outside o the pthread API set are the ENDJOB *IMMED CL command, a thread ending from an unhandled exception, or the operator terminating a thread using the work with threads screen (Option 20 from the WRKJOB display).
pthread_cancel()--Cancel a Thread
pthread_cleanup_peek_np()--Copy the Cleanup Handler from the Cancelation Cleanup Stack
pthread_cleanup_pop()--Pop a Cleanup Handler off of the Cancelation Cleanup Stack
pthread_cleanup_push()--Push a Cleanup Handler onto the Cancelation Cleanup Stack
pthread_getcancelstate_np()--Get Cancel State
pthread_setcancelstate()--Set Cancel State
pthread_setcanceltype()--Set Cancel Type
pthread_testcancel()--Create a Cancelation Point
pthread_test_exit_np()--Test the Thread Exit Status



[Prev] [Contents] [Next]
Copyright © 1998, IBM Corporation. All rights reserved.
Comments? Contact
rchthrds@us.ibm.com