Add C11 call_once() support to go with C11 threads and mutexes. Signed-off-by: Christopher Friedt <cfriedt@meta.com>
17 lines
288 B
C
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);
|
|
}
|