pthread: Add logic to disable cancellation points within the OS
This is useful when an internal OS function that is NOT a cancellation
point calls an OS function which is a cancellation point. In that case,
irrecoverable states may states may occur if the cancellation is within
the OS.
All credits should go to Juha Niskanen who wrote the original commit.
Change-Id: Iaedfdcf921f4859f049d590e47ab136cb0a0b699
Signed-off-by: Juha Niskanen (Haltian) <juha.niskanen@haltian.com>
[Song: backported
b4747286 from Nuttx]
Signed-off-by: EunBong Song <eunb.song@samsung.com>