commit | 0e1ff84fe7acf0420aa430c4ef5e544f92f8b710 | [log] [tgz] |
---|---|---|
author | Jaxson Han <jaxson.han@arm.com> | Fri Mar 11 11:33:39 2022 +0800 |
committer | Marti Bolivar <marti.bolivar@nordicsemi.no> | Tue Apr 05 10:38:30 2022 -0700 |
tree | 5bbda8da9332d7ca99b96cfaf6ae32205bc87bdc | |
parent | 5a4a15edcf70303f9d7a0f4ceb8dc4c69f40950e [diff] |
posix: Fix pthread_once has incorrect behavior As described in https://pubs.opengroup.org/onlinepubs/7908799/xsh/pthread_once.html. The behavior of pthread_once() is undefined if once_control has automatic storage duration or is not initialized by PTHREAD_ONCE_INIT However, in Zephyr, the implementation is incorrect. If the init value is PTHREAD_ONCE_INIT, the program will never run the init_func. Signed-off-by: Jaxson Han <jaxson.han@arm.com>