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:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/pthread_testcancel.html

other cancellation points (includes read()):
http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html#tag_15_09_05_02
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.