You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
649 B
30 lines
649 B
/* |
|
* Copyright (c) 2016-2017 Wind River Systems, Inc. |
|
* Copyright (c) 2024 Intel Corporation |
|
* |
|
* SPDX-License-Identifier: Apache-2.0 |
|
*/ |
|
|
|
#ifndef ZEPHYR_KERNEL_INCLUDE_THREAD_H_ |
|
#define ZEPHYR_KERNEL_INCLUDE_THREAD_H_ |
|
|
|
#include <zephyr/kernel.h> |
|
#include <timeout_q.h> |
|
|
|
#ifdef CONFIG_MULTITHREADING |
|
static inline void thread_schedule_new(struct k_thread *thread, k_timeout_t delay) |
|
{ |
|
#ifdef CONFIG_SYS_CLOCK_EXISTS |
|
if (K_TIMEOUT_EQ(delay, K_NO_WAIT)) { |
|
k_thread_start(thread); |
|
} else { |
|
z_add_thread_timeout(thread, delay); |
|
} |
|
#else |
|
ARG_UNUSED(delay); |
|
k_thread_start(thread); |
|
#endif |
|
} |
|
#endif |
|
|
|
#endif /* ZEPHYR_KERNEL_INCLUDE_THREAD_H_ */
|
|
|