mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-29 02:21:44 +00:00
[artf3749] Repaired undefined behavior in takeMultiWait.
Change-Id: Ieae7d602472f585db2a896cc76355a5c23d1d670
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
|
||||
#include "HAL/Semaphore.hpp"
|
||||
|
||||
#include "Log.hpp"
|
||||
@@ -122,11 +121,10 @@ void deleteMultiWait(MULTIWAIT_ID sem) {
|
||||
delete sem;
|
||||
}
|
||||
|
||||
int8_t takeMultiWait(MULTIWAIT_ID sem, int32_t timeout) {
|
||||
MUTEX_ID m = initializeMutexNormal();
|
||||
int8_t takeMultiWait(MULTIWAIT_ID sem, MUTEX_ID m, int32_t timeout) {
|
||||
takeMutex(m);
|
||||
int8_t val = pthread_cond_wait(sem, m);
|
||||
deleteMutex(m);
|
||||
giveMutex(m);
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user