Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: cleanup

...

This code instead uses the pthread_cancel() function to terminate the thread. The thread continues to run until it reaches a cancellation point. See [Open Group 04] for lists of functions that are required to be, and allowed to be, cancellation points. If the cancellation type is set to asynchronous, the thread is terminated immediately. However, POSIX only requires the pthread_cancel(), pthread_setcancelstate(), and pthread_setcanceltype() functions to be async-cancel safe. An application that calls other POSIX functions with asynchronous cancellation enabled is non-conforming. Consequently, we recommend disallowing asynchronous cancellation, as expalined by POS47-C. Avoid using Do not use threads that can be cancelled asynchronously.

...