WPILibC++ 2027.0.0-alpha-5
Loading...
Searching...
No Matches
Threads.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include <stdint.h>
8
9#include "wpi/hal/Types.h"
10
11/**
12 * @defgroup hal_threads Threads Functions
13 * @ingroup hal_capi
14 * @{
15 */
16
17typedef const void* NativeThreadHandle;
18
19#ifdef __cplusplus
20extern "C" {
21#endif
22
23/**
24 * Gets the specified thread's priority.
25 *
26 * Priorities range from 0 to 99 where 0 is non-real-time, 1-99 are real-time,
27 * and 99 is highest priority. See "man 7 sched" for details.
28 *
29 * @param[in] handle Native thread handle.
30 * @param[out] priority The specified thread's priority.
31 * @return Error status variable. 0 on success.
32 */
34
35/**
36 * Gets the current thread's priority.
37 *
38 * Priorities range from 0 to 99 where 0 is non-real-time, 1-99 are real-time,
39 * and 99 is highest priority. See "man 7 sched" for details.
40 *
41 * @param[out] priority The current thread's priority.
42 * @return Error status variable. 0 on success.
43 */
45
46/**
47 * Sets the specified thread's priority.
48 *
49 * Priorities range from 0 to 99 where 0 is non-real-time, 1-99 are real-time,
50 * and 99 is highest priority. See "man 7 sched" for details.
51 *
52 * @param[in] handle The native thread handle.
53 * @param[in] priority The priority.
54 * @return Error status variable. 0 on success.
55 */
57
58/**
59 * Sets the current thread's priority.
60 *
61 * Priorities range from 0 to 99 where 0 is non-real-time, 1-99 are real-time,
62 * and 99 is highest priority. See "man 7 sched" for details.
63 *
64 * @param[in] priority The priority.
65 * @return Error status variable. 0 on success.
66 */
68
69#ifdef __cplusplus
70} // extern "C"
71#endif
72/** @} */
HAL_Status HAL_GetThreadPriority(NativeThreadHandle handle, int32_t *priority)
Gets the specified thread's priority.
HAL_Status HAL_SetCurrentThreadPriority(int32_t priority)
Sets the current thread's priority.
HAL_Status HAL_GetCurrentThreadPriority(int32_t *priority)
Gets the current thread's priority.
HAL_Status HAL_SetThreadPriority(NativeThreadHandle handle, int32_t priority)
Sets the specified thread's priority.
const void * NativeThreadHandle
Definition Threads.h:17
int32_t HAL_Status
Definition Types.h:67