pthread_testcancel() before and after read(...)

What is the significance of calling pthread_testcancel() before and after a read(...) call?
Perhaps the original author of that code was writing for a non-POSIX system where read() is not a cancellation point? Normally, pthread_testcancel() after read() is redundant.

what testcancel does:

other cancellation points (includes read()):
Thank you! I have one more question and googling did not give me an easy answer.
Why exactly should we create cancellation points?
Last edited on
They make it possible to terminate a thread without terminating the whole process.
Topic archived. No new replies allowed.