Zephyr API
4.5.99
A Scalable Open Source RTOS
Toggle main menu visibility
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
36
#include <
zephyr/kernel/thread.h
>
37
#include <
zephyr/sys/atomic.h
>
38
40
/* Thread state: paused and resumable, running, or terminated */
41
enum
mpipe_thread_state {
42
MPIPE_THREAD_PAUSED = 0,
43
MPIPE_THREAD_RUNNING,
44
MPIPE_THREAD_TERMINATED,
45
};
47
54
struct
mpipe_thread
{
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 */
61
atomic_t
state
;
64
int
priority
;
65
};
66
87
k_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
102
int
mpipe_thread_wait
(
struct
mpipe_thread
*thread);
103
109
void
mpipe_thread_resume
(
struct
mpipe_thread
*thread);
110
118
void
mpipe_thread_pause
(
struct
mpipe_thread
*thread);
119
134
int
mpipe_thread_join
(
struct
mpipe_thread
*thread,
k_timeout_t
timeout);
135
137
138
#endif
/* ZEPHYR_INCLUDE_MPIPE_MPIPE_THREAD_H_ */
k_thread_entry_t
void(* k_thread_entry_t)(void *p1, void *p2, void *p3)
Thread entry point function type.
Definition
arch_interface.h:46
atomic.h
Header file for the Atomic operations API.
atomic_t
long atomic_t
Atomic integer variable.
Definition
atomic_types.h:34
mpipe_thread_join
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.
mpipe_thread_pause
void mpipe_thread_pause(struct mpipe_thread *thread)
Pause a running thread.
mpipe_thread_resume
void mpipe_thread_resume(struct mpipe_thread *thread)
Resume a paused thread.
mpipe_thread_wait
int mpipe_thread_wait(struct mpipe_thread *thread)
Block the thread until it is allowed to run or must exit.
mpipe_thread_create
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.
thread.h
k_tid_t
struct k_thread * k_tid_t
Definition
thread.h:414
state
state
Definition
parser_state.h:29
uint8_t
__UINT8_TYPE__ uint8_t
Definition
stdint.h:88
k_sem
Semaphore structure.
Definition
kernel.h:3752
k_thread
Thread Structure.
Definition
thread.h:258
k_timeout_t
Kernel timeout type.
Definition
clock.h:65
mpipe_thread
Simple wrapper around k_thread.
Definition
mpipe_thread.h:54
mpipe_thread::priority
int priority
Priority of the thread.
Definition
mpipe_thread.h:64
zephyr
mpipe
mpipe_thread.h
Generated on
for Zephyr API by
1.17.0