Previously, Zephyr's POSIX API did not differentiate between
deferred and asynchronous pthread cancellation. In fact all
pthread cancellation was asynchronous. According to the spec,
all pthreads should be created with deferred cancellation by
default.
Note: PTHREAD_CANCEL_ASYNCHRONOUS means cancel asynchronously
with respect to cancellation points (but synchronously with
respect to the thread that callse pthread_cancel(), which is
perhaps unintuitive).
The POSIX timer relied on this non-standard convention.
Oddly, this change prevents what would have otherwise been a
regression that would have been caused by fixing pthread
behaviour (in a separate commit).
We are effectively uncovering bugs which were probably always
present in the pthread.c and timer.c implementations going
back quite a few years.
Signed-off-by: Christopher Friedt <cfriedt@meta.com>