WPILibC++  2018.4.1-20180921134745-1191-g456d3e1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Modules Pages
Threads.h
1 /*----------------------------------------------------------------------------*/
2 /* Copyright (c) 2016-2018 FIRST. All Rights Reserved. */
3 /* Open Source Software - may be modified and shared by FRC teams. The code */
4 /* must be accompanied by the FIRST BSD license file in the root directory of */
5 /* the project. */
6 /*----------------------------------------------------------------------------*/
7 
8 #pragma once
9 
10 #ifdef _WIN32
11 #include <windows.h>
12 #define NativeThreadHandle const HANDLE*
13 #else
14 #include <pthread.h>
15 #define NativeThreadHandle const pthread_t*
16 #endif
17 
18 #include "hal/Types.h"
19 
26 extern "C" {
36 int32_t HAL_GetThreadPriority(NativeThreadHandle handle, HAL_Bool* isRealTime,
37  int32_t* status);
38 
48 int32_t HAL_GetCurrentThreadPriority(HAL_Bool* isRealTime, int32_t* status);
49 
61 HAL_Bool HAL_SetThreadPriority(NativeThreadHandle handle, HAL_Bool realTime,
62  int32_t priority, int32_t* status);
63 
75 HAL_Bool HAL_SetCurrentThreadPriority(HAL_Bool realTime, int32_t priority,
76  int32_t* status);
77 } // extern "C"
HAL_Bool HAL_SetCurrentThreadPriority(HAL_Bool realTime, int32_t priority, int32_t *status)
Sets the thread priority for the current thread.
int32_t HAL_GetThreadPriority(NativeThreadHandle handle, HAL_Bool *isRealTime, int32_t *status)
Gets the thread priority for the specified thread.
int32_t HAL_GetCurrentThreadPriority(HAL_Bool *isRealTime, int32_t *status)
Gets the thread priority for the current thread.
HAL_Bool HAL_SetThreadPriority(NativeThreadHandle handle, HAL_Bool realTime, int32_t priority, int32_t *status)
Sets the thread priority for the specified thread.