i5/OS does not support the full set of cancellation points. Although the APIs may be provided, they are not necessarily cancellation points. The only cancellation points currently supported are those APIs that are part of the Pthread run-time. Those APIs are the following:
An appropriate alternative to create cancellation points for these APIs might be like the following example. You can use this example to create a cancellation point out of any function that is asynchronous signal safe. See Signal Concepts for a list of functions that are asynchronous signal safe. If a function is not asynchronous signal safe, you should not use this form of asynchronous cancellation because it corrupt data.
See Code disclaimer information for information pertaining to code examples.
... preceding code ... int oldtype=0; /* If cancellation is currently disabled, this will have no effect */ /* if cancellation is currently enabled, we'll set it to asynchronous */ /* for the duration of this call to try to simulate a cancellation point */ pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, &oldtype); /* Call kernel API that you want to be a cancel point. You should */ /* only call functions which are asynchronous signal safe in this block. */ /* Validating the asynchronous signal safety of the function will */ /* ensure that the asynchronous cancellation does not negatively */ /* affect the API or corrupt the data that the API uses */ APICallHere(); /* Restore the cancellation type that was previously in effect */ pthread_setcanceltype(oldtype, &oldtype); ... following code ...
Top | Pthread APIs | APIs by category |