8.6. Pthread cancellation

POSIX provides facilities for canceling Pthreads. The facilities enable a Pthread to cancel another specified Pthread within the same process. The facilities are aimed at allowing applications to cancel cooperating Pthreads.

A Pthread that is the target of cancellation must be cooperative in the following sense. Each Pthread controls its own cancelability state and type. The cancelability state can be enabled or disabled. For the enabled state, the type can be asynchronous (cancellation requests accepted at any time) or deferred (cancellation accepted only at designated cancellation points). By default, Pthreads are initialized with state enabled and type deferred. An uncooperative Pthread could disable cancellation, ...

Get Developing and Porting C and C++ Applications on AIX now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.