zephyr/lib/libc/common/source/thrd/once.c
Christopher Friedt 4c58c6b4c4 libc: common: support for C11 call_once()
Add C11 call_once() support to go with C11 threads
and mutexes.

Signed-off-by: Christopher Friedt <cfriedt@meta.com>
2023-11-14 18:23:42 +09:00

17 lines
288 B
C

/*
* Copyright (c) 2023, Meta
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <errno.h>
#include <threads.h>
#include <zephyr/kernel.h>
#include <zephyr/posix/pthread.h>
void call_once(once_flag *flag, void (*func)(void))
{
(void)pthread_once((pthread_once_t *)flag, func);
}