Loading...
Searching...
No Matches
thread.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2020 Kaspar Schleiser <kaspar@schleiser.de>
3 * 2020 Freie Universität Berlin
4 * 2020 Inria
5 *
6 * This file is subject to the terms and conditions of the GNU Lesser
7 * General Public License v2.1. See the file LICENSE in the top level
8 * directory for more details.
9 */
10
11#pragma once
12
80
81#include <stddef.h>
82
83#include "event.h"
84
85#ifdef __cplusplus
86extern "C" {
87#endif
88
101void event_thread_init_multi(event_queue_t *queues, size_t queues_numof,
102 char *stack, size_t stack_size,
103 unsigned priority);
104
113static inline void event_thread_init(event_queue_t *queue,
114 char *stack, size_t stack_size,
115 unsigned priority)
116{
117 event_thread_init_multi(queue, 1, stack, stack_size, priority);
118}
119
127enum {
132};
133
134extern event_queue_t event_thread_queues[EVENT_QUEUE_PRIO_NUMOF];
135
139#define EVENT_PRIO_HIGHEST (&event_thread_queues[EVENT_QUEUE_PRIO_HIGHEST])
143#define EVENT_PRIO_MEDIUM (&event_thread_queues[EVENT_QUEUE_PRIO_MEDIUM])
147#define EVENT_PRIO_LOWEST (&event_thread_queues[EVENT_QUEUE_PRIO_LOWEST])
148
149#ifdef __cplusplus
150}
151#endif
struct PTRTAG event_queue_t
event queue structure
@ EVENT_QUEUE_PRIO_LOWEST
Lowest event queue priority.
Definition thread.h:130
@ EVENT_QUEUE_PRIO_NUMOF
Number of event queue priorities.
Definition thread.h:131
@ EVENT_QUEUE_PRIO_MEDIUM
Medium event queue priority.
Definition thread.h:129
@ EVENT_QUEUE_PRIO_HIGHEST
Highest event queue priority.
Definition thread.h:128
static void event_thread_init(event_queue_t *queue, char *stack, size_t stack_size, unsigned priority)
Convenience function for initializing an event queue thread.
Definition thread.h:113
void event_thread_init_multi(event_queue_t *queues, size_t queues_numof, char *stack, size_t stack_size, unsigned priority)
Convenience function for initializing an event queue thread handling multiple queues.