mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-21 01:01:43 +00:00
Fixes missing Extern "C" from HAL Threads (#437)
Also fixes incorrect return value during set
This commit is contained in:
committed by
Peter Johnson
parent
182f57216f
commit
64eab1f7b3
@@ -12,6 +12,7 @@
|
||||
|
||||
#include "HAL/Errors.h"
|
||||
|
||||
extern "C" {
|
||||
/**
|
||||
* Get the thread priority for the specified thread.
|
||||
*
|
||||
@@ -94,10 +95,10 @@ HAL_Bool HAL_SetThreadPriority(NativeThreadHandle handle, HAL_Bool realTime,
|
||||
sch.sched_priority = 0;
|
||||
if (pthread_setschedparam(*handle, scheduler, &sch)) {
|
||||
*status = HAL_THREAD_PRIORITY_ERROR;
|
||||
return true;
|
||||
return false;
|
||||
} else {
|
||||
*status = 0;
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,3 +119,4 @@ HAL_Bool HAL_SetCurrentThreadPriority(HAL_Bool realTime, int32_t priority,
|
||||
auto thread = pthread_self();
|
||||
return HAL_SetThreadPriority(&thread, realTime, priority, status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user