Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
threads.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2025 The Paparazzi Team
3 *
4 * This file is part of paparazzi.
5 *
6 * Paparazzi is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * See LICENSE file for the full license version, or see http://www.gnu.org/licenses/
12 */
13
14#pragma once
15#include "stdbool.h"
16#include "modules/core/threads_arch.h"
17#include "stdint.h"
18#include <stddef.h>
19
20
21typedef struct pprzMutex pprz_mutex_t;
22typedef struct pprzBSem pprz_bsem_t;
23
24
27
34
38
51int pprz_thread_create(pprz_thread_t* thread, size_t size, const char *name, uint8_t prio, void (*func)(void*), void* arg) THREADS_ATTRIBUTES;
52
58
66
67
thread_t * pprz_thread_t
#define THREADS_ATTRIBUTES
uint16_t foo
Definition main_demo5.c:58
pprz_bsem_t bsem
Definition thd_test.c:34
pprz_mutex_t mtx
Definition thd_test.c:36
int pprz_thread_create(pprz_thread_t *thread, size_t size, const char *name, uint8_t prio, void(*func)(void *), void *arg) THREADS_ATTRIBUTES
Creates a new thread whose stack is dynamically allocated.
int pprz_mtx_trylock(pprz_mutex_t *mtx)
Performs a nonblocking lock on the mutex.
int pprz_thread_tryjoin(pprz_thread_t *thread, void **retval) THREADS_ATTRIBUTES
Performs a nonblocking join with the thread.
int pprz_mtx_unlock(pprz_mutex_t *mtx)
void pprz_bsem_init(pprz_bsem_t *bsem, bool taken)
int pprz_mtx_init(pprz_mutex_t *mtx)
void pprz_thread_exit(void *retval) THREADS_ATTRIBUTES
Exit the current thread.
int pprz_mtx_lock(pprz_mutex_t *mtx)
void pprz_bsem_signal(pprz_bsem_t *bsem)
int pprz_thread_join(pprz_thread_t *thread, void **retval) THREADS_ATTRIBUTES
Wait for the thread to terminate.
void pprz_bsem_wait(pprz_bsem_t *bsem)
unsigned char uint8_t
Typedef defining 8 bit unsigned char type.