WPILibC++  2018.4.1-20180729123227-1139-ga11fcb6
 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 
20 extern "C" {
30 int32_t HAL_GetThreadPriority(NativeThreadHandle handle, HAL_Bool* isRealTime,
31  int32_t* status);
32 
42 int32_t HAL_GetCurrentThreadPriority(HAL_Bool* isRealTime, int32_t* status);
43 
55 HAL_Bool HAL_SetThreadPriority(NativeThreadHandle handle, HAL_Bool realTime,
56  int32_t priority, int32_t* status);
57 
69 HAL_Bool HAL_SetCurrentThreadPriority(HAL_Bool realTime, int32_t priority,
70  int32_t* status);
71 } // extern "C"