Skip to content
Commit 98a631b5 authored by Yong Cong Sin's avatar Yong Cong Sin Committed by Carles Cufí
Browse files

posix: pthread: allow `oldstate` & `oldtype` to be `NULL`



The POSIX standard doesn't specify if the argument to store
previous state/type in
`pthread_setcancelstate`/`pthread_setcancelstate` can be
`NULL`, but threading implementations in Linux & Apache NuttX
permit the arguments to be `NULL`.

This commit changes Zephyr's implementation to mimic that of
Linux & NuttX, so that user do not get caught off-guard by
NULL pointer dereferencing when porting code over from those
OSes.

Updated test accordingly.

Signed-off-by: default avatarYong Cong Sin <ycsin@meta.com>
parent 81d524d0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment