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
54
55#include <stddef.h>
56
57#include "event.h"
58
59#ifdef __cplusplus
60extern "C" {
61#endif
62
75void event_thread_init_multi(event_queue_t *queues, size_t queues_numof,
76 char *stack, size_t stack_size,
77 unsigned priority);
78
87static inline void event_thread_init(event_queue_t *queue,
88 char *stack, size_t stack_size,
89 unsigned priority)
90{
91 event_thread_init_multi(queue, 1, stack, stack_size, priority);
92}
93
101enum {
106};
107
108extern event_queue_t event_thread_queues[EVENT_QUEUE_PRIO_NUMOF];
109
113#define EVENT_PRIO_HIGHEST (&event_thread_queues[EVENT_QUEUE_PRIO_HIGHEST])
117#define EVENT_PRIO_MEDIUM (&event_thread_queues[EVENT_QUEUE_PRIO_MEDIUM])
121#define EVENT_PRIO_LOWEST (&event_thread_queues[EVENT_QUEUE_PRIO_LOWEST])
122
123#ifdef __cplusplus
124}
125#endif
struct PTRTAG event_queue_t
event queue structure
@ EVENT_QUEUE_PRIO_LOWEST
Lowest event queue priority.
Definition thread.h:104
@ EVENT_QUEUE_PRIO_NUMOF
Number of event queue priorities.
Definition thread.h:105
@ EVENT_QUEUE_PRIO_MEDIUM
Medium event queue priority.
Definition thread.h:103
@ EVENT_QUEUE_PRIO_HIGHEST
Highest event queue priority.
Definition thread.h:102
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:87
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.