Zephyr Project API 4.5.0-rc2
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
mpipe_thread.h
Go to the documentation of this file.
1/*
2 * Copyright 2025-2026 NXP
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
12
13#ifndef ZEPHYR_INCLUDE_MPIPE_MPIPE_THREAD_H_
14#define ZEPHYR_INCLUDE_MPIPE_MPIPE_THREAD_H_
15
35
37#include <zephyr/sys/atomic.h>
38
40/* Thread state: paused and resumable, running, or terminated */
41enum mpipe_thread_state {
42 MPIPE_THREAD_PAUSED = 0,
43 MPIPE_THREAD_RUNNING,
44 MPIPE_THREAD_TERMINATED,
45};
47
56 struct k_thread thread;
57 /* Gates run / pause transitions */
58 struct k_sem sem;
59 uint8_t stack_id;
60 /* enum mpipe_thread_state */
65};
66
87k_tid_t mpipe_thread_create(struct mpipe_thread *thread, k_thread_entry_t func, void *p1, void *p2,
88 void *p3, int priority, k_timeout_t delay);
89
102int mpipe_thread_wait(struct mpipe_thread *thread);
103
110
118void mpipe_thread_pause(struct mpipe_thread *thread);
119
134int mpipe_thread_join(struct mpipe_thread *thread, k_timeout_t timeout);
135
137
138#endif /* ZEPHYR_INCLUDE_MPIPE_MPIPE_THREAD_H_ */
void(* k_thread_entry_t)(void *p1, void *p2, void *p3)
Thread entry point function type.
Definition arch_interface.h:48
long atomic_t
Atomic integer variable.
Definition atomic_types.h:34
int mpipe_thread_join(struct mpipe_thread *thread, k_timeout_t timeout)
Join a thread and release its stack back to the thread stack pool.
void mpipe_thread_pause(struct mpipe_thread *thread)
Pause a running thread.
void mpipe_thread_resume(struct mpipe_thread *thread)
Resume a paused thread.
int mpipe_thread_wait(struct mpipe_thread *thread)
Block the thread until it is allowed to run or must exit.
k_tid_t mpipe_thread_create(struct mpipe_thread *thread, k_thread_entry_t func, void *p1, void *p2, void *p3, int priority, k_timeout_t delay)
Create a new thread reusing the stack from the thread pool.
struct k_thread * k_tid_t
Definition thread.h:414
state
Definition parser_state.h:29
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
Semaphore structure.
Definition kernel.h:3738
Thread Structure.
Definition thread.h:258
Kernel timeout type.
Definition clock.h:65
Simple wrapper around k_thread.
Definition mpipe_thread.h:54
int priority
Priority of the thread.
Definition mpipe_thread.h:64
Header file for the Atomic operations API.