3 ms·
The article is kinda useless, to be honest. Seems to be some sort of advanced blog spam and not somebody speaking from real experience. Anyways, pthread_cancel
by otabdeveloper4 3y ago
The article is kinda useless, to be honest. Seems to be some sort of advanced blog spam and not somebody speaking from real experience.
Anyways, pthread_cancel can be of two types - asynchronous or deferred. Deferred is when cancellation happens only during a system call. It's the default and what you want. (You don't want the asynchronous mode.)
Under the hood thread cancellation is a C++ exception, so you still get RAII, etc.